👁 0
Q: What are the four divisions of a COBOL program?
Answer:
- IDENTIFICATION DIVISION - Program identification (PROGRAM-ID)
- ENVIRONMENT DIVISION - Hardware/software environment, file assignments
- DATA DIVISION - Data definitions (FILE, WORKING-STORAGE, LINKAGE SECTION)
- PROCEDURE DIVISION - Executable code and business logic
Only IDENTIFICATION and PROCEDURE DIVISION are mandatory.
👁 0
Q: What are nested programs?
Answer:
Nested programs are contained within another COBOL program. Defined between IDENTIFICATION DIVISION and END PROGRAM. Can access outer program's data with GLOBAL clause. COMMON attribute allows access from sibling programs. Promotes modular design.
👁 0
Q: What is TITLE statement?
Answer:
TITLE 'Page Header' sets listing page headers. Appears on each page of compilation listing. Useful for documentation. Multiple TITLES change as encountered. After IDENTIFICATION DIVISION start. Compiler directive, not executable.
👁 0
Q: Explain IDENTIFICATION DIVISION
Answer:
IDENTIFICATION DIVISION identifies program. PROGRAM-ID required (up to 8 chars for compatibility). AUTHOR, DATE-WRITTEN, DATE-COMPILED, REMARKS are documentation. INSTALLATION for deployment info. Only PROGRAM-ID affects compilation.