Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Replacing expressions in the input

&pagelevel(3)&pagelevel

The value of a procedure parameter, an S variable expression or a job variable can substitute a command/statement portion. The expression to be substituted is marked by a '&' character, followed immediately by the name of the procedure parameter or job variable or by an S variable expression enclosed in parentheses. SDF substitutes the actual value for the expression prior to execution of the command/statement and performs a syntax check on the resulting input. This substitution of expressions is permissible in unguided dialog, in procedures and in batch mode. In (temporarily) guided dialog, it is restricted to the NEXT line and to input for operand values.

Substituting procedure parameters

In non-S procedures, expressions of the form '&parameter', when used in commands, are replaced by the value assigned to parameter in the command BEGIN-PROCEDURE or CALL-PROCEDURE or during prompting. When used in input data (read from SYSDTA), such expressions are replaced only if an escape character (#, @, & or *) has been defined in the ESCAPE-CHARACTER operand of the BEGIN-PROCEDURE command and the expression begins with this character.
When used in statements (read from SYSSTMT), such expressions are currently replaced as in commands. It is, however, advisable to define ESCAPE-CHARACTER='&', because the handling of such expressions may be modified.

The following restrictions apply to substituting procedure parameters:

  • No substitution is possible within CJC command sequences.

  • In procedures or ENTER files, procedure parameters 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.

  • Expressions cannot be nested.

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