section to describe data items before and after scanning. CMS Command and Macro Reference, which contains the descrIptIons of--the-ixic -control-statements, uses this
well. Therefore, as you create yourEXEC procedures, you
the items that you enter on anEXEC statement as tokens,
how they are used by theEXEC interpreter. Variables The VMLJ1.Q formats and
convention asmay think of
since that is
To make the best use of theCMS EXEC facilities, you should have an
understanding of how theEXEC interpreter performs substitutions on
variable symbols contained in tokens.Some examples follow. For each example, the input lines are shown as they would appear in an EXEC file
and as they would appear after being interpreted and executedby EXEC. Notes concerning substitution follow each example. Most of the EXEC examples in this publication
contain variable symbols that result in one-for-one substitution.Most of your variables, too, will have a similar relationship.
LinesSX-;-123 &TIPE &X After Substitution SX-;-123---------- &TIPE 123
TheEXEC interpreter accepts the variable symbol &X and assigns it the
value 123. In the second statement,&X is substituted with this value,
and the control statement&TIPE is recognized and executed.
LinesSY--;-456 &Z = &Y After Substitution Sy-;-456---------- &z = 456
The symbol&Y is assigned a value of 456. In the second statement, the
symbol &I is substituted with this value, and this value is assigned to
&z.SUBSCRIPTS FOR VARIABLES: Since each token is scanned more than once for aipersands,-you-can-sIiulate subscripts by using two variable values in
thesame token.
LinesS'-;-ALPHA &2 = BETA &INDEXl = 1 &TIPE &&INDEXl &INDEXl = 2 &TIPE &&INDEXl After Substitution &'-;-ALPHi-------- &2 = BETA &INDEXl = 1 &TIPE ALPHA &INDEXl = 2 &TIPE BETA
In the statement&TIPE &&INDEX1, the token &INDEX1 is scanned the first time, and the value &INDEXl is substituted with the value 1. The token
now contains &1, which is substituted with the valueALPHA on a second
scan.When the value of &INDEX1 is changed to 2, the value of &&INDEXl also changes. &1 = 2 &X&I = 5 &1 = 1 &X&I = 2 &X = &X&I + &X&X&I After Substitution &1-;-2------------ &X2 = 5 &1 = 1 &Xl = 2 &X = 2 + 5
268IBM VM/310 CMS User's Guide
well. Therefore, as you create your
the items that you enter on an
how they are used by the
convention as
since that is
To make the best use of the
understanding of how the
variable symbols contained in tokens.
and as they would appear after being interpreted and executed
contain variable symbols that result in one-for-one substitution.
Lines
The
value 123. In the second statement,
and the control statement
Lines
The symbol
symbol &I is substituted with this value, and this value is assigned to
&z.
the
Lines
In the statement
now contains &1, which is substituted with the value
scan.
268