Previous Topic: &ZSOCINFO

Next Topic: &ZSYSPARM


&ZSUBST

Returns a string with substituted data.

&ZSUBST subchar data

&ZSUBST provides a means of substituting data in a string or variable. Normally NCL substitution uses the ampersand (&) character to indicate the start of a variable name. You can use the &ZSUBST built-in function to substitute a string of data using a different character.

&ZSUBST is a built-in function and must be used to the right of an assignment statement.

Operands:

subchar

This is the substitution character. It is:

c

Any single character

C 'c'

Any single quoted character (including a blank)-double quotes is used

X 'xx'

A hexadecimal pair representing the wanted character

data

The data to substitute. The data is in a variable. It is the data after normal substitution that is then passed through a single substitution pass using the nominated character instead of the ampersand.

Examples: &ZSUBST

&A = PARIS  
&TEST = @A  
&RESULT = &ZSUBST @ &TEST -* &RESULT will contain PARIS