Example:
Parse Numeric Var1
After this instruction, Var1 would be equal to: 9 0 SCIENTIFIC. See section “NUMERIC” on page 150
and the built-in functions in section “DIGITS” on page 183, and section “FORM” on page 185, and
section “FUZZ” on page 186.
PARSE PULL
parses the next string from the external data queue. If the external data queue is empty, PARSE PULL
reads a line from the default input stream (the user's terminal), and the program pauses, if necessary,
until a line is complete. You can add data to the head or tail of the queue by using the PUSH and
QUEUE instructions. You can find the number of lines currently in the queue with the QUEUED built-in
function, see page 190. Other programs in the system can alter the queue and use it as a means of
communication with programs written in REXX. See also the PULL instruction on page 158.
Note: PULL and PARSE PULL read from the program stack. If that is empty, they read from the
terminal input buffer; and if that too is empty, they read from the console. (See the PULL
instruction, on page “Purpose” on page 158, for further details.)
PARSE SOURCE
parses data describing the source of the program running. The language processor returns a string
that is fixed (does not change) while the program is running. It returns a source string containing the
following tokens:
1. The characters CICS.
2. The string COMMAND, FUNCTION, or SUBROUTINE depending on whether the program was
invoked as some kind of host command, from a function call in an expression, by a CALL
instruction, or as a server process.
3. The name of the exec in uppercase. The name of the file (RFS), or VSE Librarian Sublibrary from
which the exec was originally loaded. The three formats are:
v Library.sublibrary(member)
v RFS fully qualified file identifier
v Dataset name (member)
4. Initial (default) host command environment that is always REXXCICS.
5. Identifier of the specific CICS/ESA environment, which in this case is REXX/CICS.
PARSE VALUE
parses the data that is the result of evaluating expression. If you specify no expression, the null string
is used. Note that WITH is a subkeyword in this context and cannot be used as a symbol within
expression.
Thus, for example:
PARSE VALUE time() WITH hours ':' mins ':' secs
gets the current time and splits it into its constituent parts.
PARSE VAR name
parses the value of the variable name. The name must be a symbol that is valid as a variable name
(that is, it cannot start with a period or a digit). Note that the variable name is not changed unless it
appears in the template, so that for example:
PARSE VAR string word1 string
removes the first word from string, puts it in the variable word1, and assigns the remainder back to
string. Similarly
PARSE UPPER VAR string word1 string
in addition translates the data from string to uppercase before it is parsed.
PARSE
Chapter 13. Keyword Instructions 153