Previous Topic Next topic Print topic


Example Record Sequential File Definition - Variable Length Records

To define a record sequential file with variable length records:

 file control.
     select recseqv
         assign to "recseqv.dat"
         organization is record sequential.
      ...
 file section.
 fd recseqv
    record varying from 3 to 80 characters depending on ws-record-length.
 01 recseqv-fd-record  pic x(80).
   ...
 working-storage section.
 01 ws-record-length   pic 99.

You could simply use ORGANIZATION IS SEQUENTIAL, as record sequential is the default for sequential files, as long as the SEQUENTIAL Compiler directive is not set.

Previous Topic Next topic Print topic