EXEC Built-In Functions-&CONCAT
Bu i It-I nFu nctions You can use the
variable symbols.
may be crsed only
follows: EXEC built-in functions to assign and manipulate With the exception of &LITERAL, built-in functions
on the right-hand side of an assignment statement, as &MIX = &CONCAT &1 &2
Built-in functions may not be combined with arithmetic expressions.
Each of the built-in functions (&CONCAT, and &SUBSTR) is described separately. &CONCAT &DATATYPE, &LENGTH, Use the &CONCAT function to concatenate two or more tokens and assign
the rescrlt to a variable symbol. The format of the &CONCAT function is:
r I &variable = &CONCAT tokl [tok2 ••• [tokn]] L- &variable is the variable symbol whose value is determined by the function.
tokl [tok2 •.• [tokn]1
specifies the tokens that are to be concatenated into a
single token; for example:
&A = **
&B = &CONCAT XX &A 45 &TYPE &B
results in the printed line: XX**45 If the concatenated token is longer than eight characters, the data is
left-justified and truncated on the right. Section 5. EXEC Control Statements 291
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.
Previous Page Next Page