FILE SECTION entries

The entries that you can use in the FILE SECTION are summarized in the table below.

Table 1. FILE SECTION entries
Clause To define Notes
FD The file-name to be referred to in PROCEDURE DIVISION input-output statements (OPEN, CLOSE, READ, also START and DELETE for VSAM) Must match file-name in the SELECT clause. file-name is associated with a ddname through the assignment-name.
BLOCK CONTAINS Size of physical records If the CHARACTERS phrase is specified, size indicates the number of bytes in a record regardless of the USAGE of the data items in the record.

QSAM: If provided, must match information on JCL or data-set label. If specified as BLOCK CONTAINS 0, or not provided, the system determines the optimal block size for you.

Line sequential: Can be specified to control buffering for WRITE statements.

VSAM: Syntax-checked, but has no effect on execution.

RECORD CONTAINS n Size of logical records (fixed length) Integer size indicates the number of bytes in a record regardless of the USAGE of the data items in the record. If the clause is provided, it must match information on JCL or data-set label. If n is equal to 0, LRECL must be coded on JCL or data-set label.
RECORD IS VARYING Size of logical records (variable length) Integer size or sizes, if specified, indicate the number of bytes in a record regardless of the USAGE of the data items in the record. If the clause is provided, it must match information on JCL or data-set label; compiler checks that record descriptions match.
RECORD CONTAINS n TO m Size of logical records (variable length) The integer sizes indicate the number of bytes in a record regardless of the USAGE of the data items in the record. If the clause is provided, it must match information on JCL or data-set label; compiler checks that record descriptions match.
LABEL RECORDS Labels for QSAM files VSAM: Handled as comments
STANDARD Labels exist QSAM: Handled as comments
OMITTED Labels do not exist QSAM: Handled as comments
data-name Labels defined by the user QSAM: Allowed for (optional) tape or disk
VALUE OF An item in the label records associated with file Comments only
DATA RECORDS Names of records associated with file Comments only
LINAGE Depth of logical page QSAM only
CODE-SET ASCII or EBCDIC files QSAM only.

When an ASCII file is identified with the CODE-SET clause, the corresponding DD statement might need to have DCB=(OPTCD=Q. . .) or DCB=(RECFM=D. . .) coded if the file was not created using VS COBOL II, COBOL for OS/390® & VM, or IBM® Enterprise COBOL for z/OS®.

RECORDING MODE Physical record description QSAM only

Related references  
FILE SECTION (Enterprise COBOL for z/OS Language Reference)