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


Limiting the level of symbolic substitution - &SYSNSUB

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

Use the &SYSNSUB built-in function to limit the number of times a CLIST performs symbolic substitution in a statement. With &SYSNSUB, you can limit the CLIST to from 0 to 99 levels of substitution.

&SYSNSUB has the following syntax:
&SYSNSUB(level,expression)
where:
level
is a positive whole number, or a symbolic variable that resolves to a positive whole number, from 0 to 99. This number tells the CLIST how many levels of symbolic substitution to perform on the expression. The level parameter cannot contain other built-in functions or expressions.
expression
is a CLIST expression whose level of symbolic substitution is to be controlled, and whose final value is to be frozen without further evaluation of any kind.
For example,
SET Y = 30             /* result: &Y contains 30
SET X = &&Y            /* result: &X contains &Y
SET Z = &&X            /* result: &Z contains &X
SET A = &SYSNSUB(2,&Z) /* result: &A contains &Y
As specified, the CLIST performs only two levels of substitution, substituting &X for &Z and then substituting &Y for &X. The CLIST does not continue and resolve &Y to 30, as it is required to be without the &SYSNSUB limit.

You can use &SYSNSUB to override the rule for double ampersands, in which the CLIST removes the first ampersand and does no substitution of the remaining variable. &SYSNSUB counts removal of the first ampersand as one level of substitution, and allows substitution to continue until the value in the level parameter is reached.

For example:
SET X = 10              /* result: &X = 10
SET Y = &&X             /* result: &Y = &X (rule for double &&)

SET Y = &SYSNSUB(2,&&X) /* result: &Y = 10 (&SYSNSUB overrides &&)
Note: The control variable &SYSSCAN restricts the levels of substitution that you can specify with &SYSNSUB. &SYSSCAN must contain a number greater than or equal to the number you specify in &SYSNSUB's level parameter.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014