What is the difference between external and global variables in COBOL?
Global Variable | External Variable |
---|---|
It is a type of variable which is available throughout the program. | Also available throughout the program, it is declared but not allocated any memory space. |
It is applicable only when sharing data among nested programs via the ANSI85 dialect. | It is used to access globally declared data, including data declared using EXTERNAL or by other COBOL programs. |
This specifies that a data-name is available for every program being contained within the program that declares it. | Here, any external data item can be referenced via any program inside the run unit describing the data item. |
BY Best Interview Question ON 06 May 2020