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


Substitution of nested variables

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

If a CLIST encounters nested symbolic variables in a line, it normally scans the line (performs symbolic substitution) multiple times until all symbolic variables are resolved. For example:
SET A = 50
SET B = &&C                     /* result:  &B contains &C
SET C = &A+50                   /* result:  &C contains 100
SET D = &&A                     /* result:  &D contains &A
SET X = (&D+&B)/&D              /* result:  &X contains 3

To resolve the fifth expression the CLIST uses the values assigned to the symbolic variables A-D and assigns the value 3 to X.

You can limit the number of times the CLIST scans a line of nested variables, using the &SYSNSUB built-in function. For example, you can specify that the CLIST scan the fifth expression in the preceding example only once, so the variables were resolved to only one level of symbolic substitution. As a result, the CLIST needs to resolve &X from (&D+&B)/&D to (&A+&C)/&A, and go no further. See Using built-in functions for a description and examples of &SYSNSUB.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014