3. Embedded QUEL for COBOL : COBOL Variables and Data Types : The Scope of Variables
 
Share this page                  
The Scope of Variables
You can reference all variables declared to EQUEL. The preprocessor accepts them from the point of declaration to the end of the file. This is not true for the COBOL compiler, which generally allows references to only those variables declared in the current program units. Because the preprocessor does not terminate the scope of a variable in the same way the COBOL compiler does, do not redeclare variables of the same name to the preprocessor in a single file even where the variables are declared in separately compiled program units. If two programs in a single file each use variables of the same name and type in EQUEL statements, you must declare only the first with the ## signal.