Setting up a field for file status

Establish a file status key by using the FILE STATUS clause in the FILE-CONTROL paragraph and data definitions in the DATA DIVISION.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
    . . .
    FILE STATUS IS file-status
WORKING-STORAGE SECTION.
01  file-status  PIC 99.

Specify the file status key file-status as a two-character category alphanumeric or category national item, or as a two-digit zoned decimal (USAGE DISPLAY) (as shown above) or national decimal (USAGE NATIONAL) item.

Restriction: The data item referenced in the FILE STATUS clause cannot be variably located; for example, it cannot follow a variable-length table.

related tasks  
Using file status keys

related references  
FILE STATUS clause (COBOL for AIX Language Reference)