Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 11:- Library Facility and sub-programming


Nested programs

  • In COBOL-85, it is allowed to code nested programs, i.e. one program may contain another program(s). The another program(s) themselves may contain yet another program(s)
  • Below image depicts the concept of Nested programs
  • With introduction of nested program concept, following are few statements also introduced:-
    • END PROGRAM statement: All contained and containing programs are terminated using END PROGRAM statement. END PROGRAM statement is described in detail here .
    • IS GLOBAL clause: If you want to access working storage data item of contained program in containing prgrams then declare them with ‘IS GLOBAL’ clause. "IS GLOBAL clause" is described in detail here .
    • IS EXTERNAL clause: If you want to access working storage data item of containing programs in contained prgram then declare them with ‘IS EXTERNAL’ clause. "IS EXTERNAL clause" is described in detail here .
    • IS {COMMON/INITIAL} clause: With introduction of nesting of programs, the syntax of PROGRAM-ID paragraph has been extended by appending "IS {COMMON/INITIAL} clause". "IS {COMMON/INITIAL} clause" is described in detail here .
  • Each of above statements/clauses explained in detail in upcoming articles



Advertisements






© copyright mainframebug.com
Privacy Policy