Mainframe: Global, External, Initial , Common in COBOL

COBOL-85 FeaturesGlobal: This is the term used in Nested programs. If declare as global, it applies to all nested programs.

External: If declare any variable as external, it can be referenced by including program(outer) in nested programs.

PROGRAM-ID. pgm1    IS COMMAN  PROGRAM.

This is an extention in cob-85 for nested programs. The program defined as ‘common’ can be called by any program  in run unit(nested programs).

Initial:

PROGRAM-ID. pgm1   IS INITIAL.

If we declare as “initial”, this will be available as initial state whenever it is called.

CALL ‘pgm2’ USING J

END-CALL.

To Cancel “initial” state:

The program which is defined as Initial, get cancel implicitly without END-CALL.

To Cancel “Common: state:

The program which is defined as “common”, to get cancel its common state, need to mention END-CALL.

Advertisements

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.