How to Read Indexed File syntax

COBOL Indexed file tips
COBOL Indexed file tips
Select filename-1 Assign to Imp-1
Organization is indexed
Access Mode is Random
Record Key is data-1

Indexed file you can open as I/O mode to read and write the same file.

Note: Access mode is Random. That means you cannot access the record sequentially.

Read Syntax

Move T-partno  to Part-no
Read Trans-file
At end Move 'No' to Are-there-no-records
Not at end
     Move T-partno to Part-no
     Read Indexed-file
       Invalid key  Perform 600-err-rtn
       Not Invalid Key   Perform 500-ok-rtn
End-Read
Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.