If your COBOL program writes records to a new file that will be made available before the program runs, ensure that the file attributes in the DD statement, the environment variable, or the allocation do not conflict with the attributes in the program.
Usually you need to code only a minimum of parameters when predefining files. But if you need to explicitly set a length attribute for the data set (for example, you are using an ISPF allocation panel, or your DD statement is for a batch job in which the program uses RECORD CONTAINS 0), follow these guidelines:
For example, if your program contains the following code for a file that has variable-length records, the LRECL value in the DD statement or allocation should be 54.
FILE SECTION.
FD COMMUTER-FILE-MST
RECORDING MODE IS V
RECORD CONTAINS 10 TO 50 CHARACTERS.
01 COMMUTER-RECORD-A PIC X(10).
01 COMMUTER-RECORD-B PIC X(50).
related tasks
Processing existing files
Requesting fixed-length format
Requesting variable-length format
Requesting undefined format
Opening QSAM files
Dynamically creating QSAM files
related references
FILE SECTION entries