Multiple choice technology mainframe

To use a variable from a main progam in the sub program

  1. it should be defined as GLOBAL

  2. should be included in the linkage section

  3. Both a and b

  4. Cannot be used

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In COBOL, to use a variable from a main program in a subprogram, it must be defined as GLOBAL in the main program to make it accessible across programs. Additionally, it should be included in the linkage section of the subprogram to establish the communication between programs. Both requirements are necessary for proper data sharing.