Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

& replacement

&pagelevel(4)&pagelevel

Variable values can be used to modify commands even if the use of expressions in their operand values is not permissible. In S procedures, SDF-P expressions are replaced by their value prior to command analysis proper and may occur in almost any position in command operands and command names (there are a few restrictions for some commands such as SDF-P control flow commands). The expression must be enclosed in parentheses at the appropriate position in the command and preceded by the escape symbol &. If the value of the expression is of type INTEGER or BOOLEAN, it is first converted to type STRING. The simplest expression consists of no more than the name of a simple variable; the parentheses may be omitted in this case and a period must be written to separate the variable name from any text following it unless it is followed by a blank or special character anyway:

/TIME = 40
/ENTER-JOB E.TEST1,CPU-LIMIT=&TIME           "Limit = 40 seconds"
/ENTER-JOB E.TEST2,CPU-LIMIT=&(TIME * 60)    "Limit = 40 minutes"
/ENTER-JOB E.TEST3,JOB-CLASS=JC&TIME.MAX     "Job class = JC40MAX"

Job variable values, whose syntax is similar to that in non-S procedures, are inserted in S procedures by calling the predefined function JV:

/&* check the following!
/SHOW-JV JV-CONTENTS=$USERXY.TSN
/&*  the JV is to contain the TSN of a running task
/SHOW-JOB-STATUS TSN=&(JV('$USERXY.TSN'))

In most cases, however, it will be easier to use the job variable as a container for an S variable:

/DECL-VAR DB-TSN(TYPE=STRING),CONTAINER=*JV($USERXY.TSN)
/  "..."
/SHOW-JOB-STATUS TSN=&DB-TSN

Note that recursive & replacement is not possible, i.e. if an & replacement generates another escape symbol &, this does not trigger another replacement.