EXEC Built-In Functions-&DATATYPE, &LENGTH
&DATATYPE Use the &DATATYPE function to determine
specified token is alphabetic or numeric function is:
whether
data.
the value of
The format of
the
the
r----------------·-------------------------------------------- I &variable = &DATATYPE token L- &variable
token
is the variable symbol whose value is determined by the &DATATYPE function.
specifies the target token
alphabetic or numeric data.
function has the value NUM or
type of the specified token.
&CHECK = &DATATYPE ABC &TYPE &CHECK
results in the display:
CHAR
that is to be examined for
The result of the CHAR, depending on the data
For example:
A null token is considered character :HAR is also
returned for alphameric tokens.
&LENGTH Use the &LENGTH function to determine the number of chatacters in a The format of the &LENGTH function is:
r -------, , &variable = &LENGTH token L- I &variable
token
298 IB:1 is the variable symbol whose value is determined by the
&LENGTH function.
specifies the target token that
nonblank characters. The result of
the number of nonblank characters
For example:
&LEN = &LENGTH ALPHA &TYPE &LEN
results in the display:
5 Command and Reference is to be examined for
the &LENGTH function is
in the specified token.
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
Previous Page Next Page