z/OS TSO/E CLISTs
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Global variables

z/OS TSO/E CLISTs
SA32-0978-00

Global variables are variables defined on a GLOBAL statement. They allow communication between nested CLISTs. Any CLIST in the nested chain can modify or reference the value of a global variable.

All global variables in a given CLIST must have unique names. You cannot have more global variables on the GLOBAL statement in a nested CLIST than there are on the GLOBAL statement in the top-level CLIST.

To establish global variables, first determine the total number of symbolic variables that are referenced by more than one of the CLISTs in the nested chain. (Include the top-level CLIST among those in the nested chain.) Then, code GLOBAL statements in each of the CLISTs in the chain that are involved in the passing of data.

For example, in Figure 1, assume the following global variable definitions in each of the CLISTs:

In PROC1:  GLOBAL  A B C D
In PROC2:  GLOBAL  X Y Z
In PROC3:  GLOBAL  F G H K
In PROC4:  GLOBAL  Q
In PROC5:  GLOBAL  R S.

Variables &A, &X, &F, &Q, and &R can be shared by all the CLISTs. If PROC4 sets &Q equal to D777, then &A, &X, &F, and &R are also set equal to D777.

Within nested CLISTs, global variables are positional; that is, all variables defined first refer to the same variable; all variables defined second refer to the same variable; and so on.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014