COBOL
👁 0

Q: What is FILE STATUS and common codes?

Answer:
FILE STATUS is a 2-byte field capturing I/O operation results. 00=success, 10=end-of-file, 22=duplicate key, 23=record not found, 35=file not found, 39=file attribute mismatch, 41=file already open, 47=not opened input. Essential for error handling.
COBOL
👁 0

Q: What is DECLARATIVES section?

Answer:
DECLARATIVES contains USE procedures for exception handling. USE AFTER ERROR PROCEDURE ON file-name handles file errors. USE AFTER EXCEPTION handles specific conditions. Must be first in PROCEDURE DIVISION. END DECLARATIVES marks end.