Skip to main content

Does RECORDING MODE apply to line sequential files?

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

In SELECT statements, a customer's application code declared line sequential files (using the ORGANIZATION LINE SEQUENTIAL clause).  In the FD, the application code specified RECORDING MODE V and the RECORD CONTAINS clause for these files, because of the customer's impression that line sequential files are variable length.  The customer noticed that it didn't seem to matter what values were specified in the RECORD CONTAINS clause, even if the values did not match the actual minimum and maximum record sizes in the file.

The customer was also using "mfsort" and "rebuild", and wondered whether options declaring variable-length should be specified when processing line sequential files with "mfsort" and "rebuild".

Resolution:

Line sequential files are neither truly fixed nor truly variable format files.  The presence of RECORDING MODE, RECORD CONTAINS, or RECORD VARYING IN SIZE clauses does not change the behavior of line sequential files.  For line sequential files, such clauses are ignored.

000001  select file1 assign to "file1"

000002  organization line sequential.

000003

000004  fd file1

000005   record contains 1 to 2 characters

000006   recording mode v.

000007  01 file1-rec1 pic x(80).

000008  01 file1-rec2 pic x(10).

000009

000010  open output file1.

000011  move "aaa" to file1-rec1.

000012  write file1-rec1.

000013  move "aaa" to file1-rec2.

000014  write file1-rec2.

The above 14-line program compiles without error, but the output file it produces is precisely the same (has the same checksum) whether or not the "recording mode" and "record contains" clauses are specified.  It is as though the clauses are treated as comments.

Micro Focus recommends that such clauses be removed from the FD for line sequential files, because they can cause confusion.

When using mfsort and rebuild, options indicating variable length should not be specified for line sequential files.

Old KB# 2181

#COBOL
#AcuCobol
#netexpress
#RMCOBOL
#ServerExpress

0 replies

Be the first to reply!