Q1
How do nested programs work in COBOL?
Nested programs are contained between IDENTIFICATION DIVISION and END PROGRAM. Can access outer program data with GLOBAL clause. COMMON attribute allows sibling access. Promotes modular design.
Q2
What is dynamic SQL?
SQL constructed at runtime. PREPARE creates executable. EXECUTE runs it. More flexible but less efficient. Security risk (injection).