PARSE

 ──PARSE─┬───────┬─┬──ARG───────────────────────┬─┬────────────┬─;─
           └─UPPER─┘ ├──PULL──────────────────────┤ └──template──┘

                     ├──SOURCE────────────────────┤      list
                     ├──VALUE─┬────────────┬─WITH─┤
                     │        └─expression─┘      │

                     ├──VAR──name─────────────────┤
                     └──VERSION───────────────────┘

PARSE is used to assign data from various sources to one or more variables according to the rules and templates described in the section on parsing in the OS/2 Procedures Language 2/REXX Reference.

If specified, a template is a list of symbols separated by blanks or patterns.

If template is not specified, no variables are set but action is taken to get the data ready for parsing if necessary. Thus, for PARSE PULL, a data string is removed from the current data queue; for PARSE LINEIN (and PARSE PULL if the current queue is empty), a line is taken from the default character 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 is raised, if it is enabled.

If the UPPER option is specified, the data to be parsed is first translated to uppercase (for example, a lowercase a-z to an uppercase A-Z). Otherwise, no uppercase translation takes place during the parsing.

The data used for each variant of the PARSE instruction is as follows:

PARSE ARG - The strings passed to the program, subroutine, or function as the input argument list, are parsed. See the ARG instruction for details and examples.

┴╓: The argument strings to a REXX program or internal routine can also be retrieved or checked by using the ARG built-in function.