PARSE
Purpose
PARSE
UPPER
ARG
EXTERNAL
LINEIN
NUMERIC
PULL
SOURCE
VALUE WITH
expression
VAR name
VERSION
template_list
;
PARSE assigns data (from various sources) to one or more variables according to the rules of parsing.
(See Chapter 15, “Parsing,” on page 203.)
The template_list is often a single template but may be several templates separated by commas. If
specified, each template is a list of symbols separated by blanks or patterns or both.
Each template is applied to a single source string. Specifying multiple templates is never a syntax error,
but only the PARSE ARG variant can supply more than one non-null source string. See page 211 for
information on parsing multiple source strings.
If you do not specify a template, no variables are set but action is taken to prepare the data for parsing, if
necessary. Thus for PARSE EXTERNAL and PARSE PULL, a data string is removed from the queue, for
PARSE LINEIN (and PARSE PULL if the queue is empty), a line is taken from the default input stream,
and for PARSE VALUE, expression is evaluated. For PARSE VAR, the specified variable is accessed. If it
does not have a value, the NOVALUE condition (if it is enabled) is raised.
If you specify the UPPER option, the data to be parsed is first translated to uppercase (that is, lowercase
a–z to uppercase A–Z). Otherwise, no uppercase translation takes place during the parsing.
The following list describes the data for each variant of the PARSE instruction.
PARSE ARG
parses the string or strings passed to a program or internal routine as input arguments. (See the ARG
instruction on page 134 for details and examples.)
Note: You can also retrieve or check the argument strings to a REXX program or internal routine with
the ARG built-in function (see page 175).
PARSE EXTERNAL
This is a non-SAA subkeyword provided in REXX/CICS. The next string from the terminal input buffer
is parsed. This queue may contain data that is the result of external asynchronous events—such as
user console input, or messages. If that queue is empty, a console read results. Note that this
mechanism should not be used for typical console input, for which PULL is more general, but rather
for special applications (such as debugging) where the program stack cannot be disturbed.
PARSE LINEIN
This is the same as PARSE EXTERNAL.
PARSE NUMERIC
This is a non-SAA subkeyword provided in VM. The current numeric controls (as set by the NUMERIC
instruction, see page “Purpose” on page 150) are available. These controls are in the order DIGITS
FUZZ FORM.
PARSE
152
CICS TS for VSE/ESA: REXX Guide