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

Module 11:- Library Facility and sub-programming


  • With introduction of nesting of programs, the syntax of PROGRAM-ID paragraph has been extended.
  • Basic format of PROGRMA-ID paragraph(new):-

    PROGRAM-ID. program-name [IS {|COMMON/INITIAL||} PROGRAM.]

  • In above syntax, two vertical lines including COMMON and INITIAL indicates either of these or both can be used.
  • When COMMON clause is not coded in nested program, it can be called only from the program that contains it
  • When COMMON is coded, it can be called from containing program or any program contained within containing program
  • INITIAL clause indicates that whenever the program is called, it will be available in initial state rather than the last-used state
  • With reference to below image, if PGM2 is declared with COMMON, then it can be called from PGM1 as well as from PGM4. If COMMON would have not coded, then PGM4 cannot call PGM2.

© copyright mainframebug.com
Privacy Policy