Skip to main content

Problem:

How do you get the record length when access a variable length Indexed file ?

When accessing an Indexed file how can you find our the actual record length of the record that has just been read. The file may contain multiple record types of variable length.

Resolution:

To get the current record length you need to add a DEPENDING ON clause to an FD defintion:-

       FD  TESTFILE

           RECORD IS VARYING IN SIZE FROM 40 TO 32000

           DEPENDING ON WS-REC-LEN.

If access a file using EXTFH calls directly then the record length is returned in fcd-current-rec-len on exit from a READ op call.

Old KB# 1514

#RMCOBOL
#COBOL
#netexpress
#ServerExpress
#AcuCobol