EXEC Built-in Functions-&LITERAL, &SUBSTR &LITERAL Use the &LITERAL function to inhibit variable substitution on the
specified token. The &LITERAL function may appear in any EXEC control
statement, as follows: r I [ ... ] &LITERAL token( ••• )
L
token specifies the sUbstitution. &X = **
token whose literal
For example: &LITERAL &X EQUALS &X results in the printed line: &X EQUALS **
value is to be used without &SUBSTR Use the &SUBSTR function to extract a character string from a specified
token and to assign the substring to a variable symbol. The format of
the &SUBSTR function is: r I &variable L- &variable
token
i
;
--------------------------------------------------------------, &SUBSTR token i (j] , is the variable symbol whose value is determined by the &SUBSTR function.
is the token from which the character string is to be
extracted.
specifies the character position in the token of the first
character to be used in the substring.
specifies the number of characters in tne string.
omitted, the remainder of the token is used.
If values of i and j
example:
(if given) must be positive integers. For &A = &SUBSTR ABCDE 2 3 &'!'YPE &A results in the printed line: RCD Section 5. EXEC Control statements 299
EXEC Special Variables Special Variables Special variables are variable symbols that are assigned values by the EXEC interpreter. and that you can test or display in your EXEC procedures. In some cases. you may assign your own values to EXEC special variables; these cases are noted in the variable descriptions.
&n &n special variable represents the numeric variables &1 through &30. When an is invoked. the numeric variables from &1 through &30 are
initialized according to the arguments that are passed to the EXEC file
(if any, .
The numeric variables can be reset by either an &ARGS or &READ ARGS control statement; when fewer than 30 arguments are set or reset. the
remainder of the &n variables are set to blanks. A particular argument
can be set to blanks by assigning it a percent sign (%) when invoking
the procedure. in an &ARGS control statement. or in an &READ ARGS control statement. An argument is also set to blanks if it begins with
the character X'FF' and is specified when invoking the EXEC procedure or
in an &READ ARGS control statement. You may set the values of specific
statements. value of n. however. that
than 0 is rejected by the EXEC interpreter.
&* and &$
arguments using assignment
is greater than 30 or less variables can be used to perform a collective test on all of the
arguments passed to the EXEC procedure. &* and &$ may only be used in
the &IF and &LOOP control statements and are described under the
description of the elF control You may not assign values to the special variables &* and &$. &0 The &0 special variable contains the filename of the EXEC file. You may
test and manipulate this variable. &DISKx You can use the &DISKx special variable to determine whether a disk is
an OS, DOS, or CMS disk. x represents the mode letter at which the disk
is accessed. For example, if you access an OS disk with a mode letter
of C, then the special variable &DISKC has a value of as. The possible
values for the &DISKx special variable are os (for an as disk), DOS (for
a DOS disk), CMS (for a CMS disk). and NA (when the disk is not
accessed) . You may set or change the values of an &DISKx special variable; if
you do so, however, you will no longer be able to test the status of the
disk at mode x. 300 VM/370 CMS Command and Macro Reference
Previous Page Next Page