I think the key is the use of GLOBAL variables: those available to all internal 
subroutines.  Not to be confused with EXTERNAL variables.

GLOBAL are available to all internal subroutines, as long as you don't redefine 
the name in the subroutine.  So if you want only one variable throughout, 
define it in the top level module as GLOBAL.  If you define it in an internal 
subroutine, that is a separate variable, but only available to that subroutine. 
 

EXTERNAL variables are available to any module within the run unit.  You define 
the variable in each module as EXTERNAL, which enables you to have only one 
storage location for the variable in the task.  

A variable an be both GLOBAL and EXTERNAL.

If you have two definitions of the same variable in a single module, they 
should be in different structures, and you need to qualify with the IN or OF 
notation. In that case, you can not use the GLOBAL attribute on either.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to