Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Substituting S variable expressions

&pagelevel(4)&pagelevel

In dialog mode and in S procedures, expressions of the form “&(expression)”, when used in commands, are replaced by the value of expression, where expression may be the name of an S variable, a builtin function or a valid S variable expression. If the expression is to be substituted by an S variable whose name does not contain any period, it may also have the form “&s-variable”.
Procedure parameters of an S procedure are S variables and are replaced in expressions also.

Expressions are replaced in commands. When used in input data (read from SYSDTA), such expressions are replaced only if an escape character (#, @, & or *) has been defined in the DATA-ESCAPE-CHARACTER operand of the SET-PROCEDURE-OPTIONS command and the expression begins with this character.
When used in statements (read from SYSSTMT), such expressions are currently replaced as in commands.

Expressions may be nested.

The following restrictions apply to substituting S variable expressions:

  • Control flow commands cannot be generated.

  • The S variable expression to be replaced is converted to type STRING.

  • S labels cannot be generated.

  • No substitution is possible within CJC command sequences.

  • In procedures or ENTER files, S variable expressions cannot replace the slash introducing commands or the two slashes introducing statements, the period introducing non-S labels, the semicolon separating commands or the continuation character.

  • A double “&” or escape character inhibits substitution, the second “&” or escape character is ignored.