PARSE VAR Instruction
The PARSE VAR instruction parses a specified variable into one or more variable
names that follow it. If the variable contains character information, it is not changed
to uppercase.
quote = 'Knowledge is power.'
PARSE VAR quote word1 word2 word3
/* word1 contains 'Knowledge' */
/* word2 contains 'is'
*/
/* word3 contains 'power.'
*/
The PARSE UPPER VAR instruction changes character information to uppercase
before putting it into the variables.
quote = 'Knowledge is power.'
PARSE UPPER VAR quote word1 word2 word3
/* word1 contains 'KNOWLEDGE' */
/* word2 contains 'IS'
*/
/* word3 contains 'POWER.'
*/
For more information about parsing instructions, see
.
PARSE VALUE ... WITH Instruction
The PARSE VALUE ... WITH instruction parses a specified expression, such as a
literal string, into one or more variable names that follow the WITH subkeyword. If
the literal string contains character information, it is not changed to uppercase.
PARSE VALUE 'Knowledge is power.' WITH word1 word2 word3
/* word1 contains 'Knowledge' */
/* word2 contains 'is'
*/
/* word3 contains 'power.'
*/
The PARSE UPPER VALUE instruction changes character information to uppercase
before assigning it to the variable names.
PARSE UPPER VALUE 'Knowledge is power.' WITH word1 word2 word3
/* word1 contains 'KNOWLEDGE' */
/* word2 contains 'IS'
*/
/* word3 contains 'POWER.'
*/
Ways of Parsing
Parsing separates data by comparing the data to a template (or pattern of variable
names). Separators in a template can be a blank, string, variable, or number that
represents column position.
Blank
The simplest template is a group of variable names separated by blanks. Each
variable name gets one word of data in sequence except for the last, which gets the
remainder of the data. The last variable name might then contain several words and
possibly leading and trailing blanks.
PARSE VALUE 'Value
with Blanks.' WITH pattern type
/* pattern contains 'Value'
*/
/* type contains '
with Blanks.'
*/
When there are more variables than data, the extra variables are set to null.
PARSE VALUE 'Value with Extra Variables.' WITH data1 data2 data3 data4 data5
/* data1 contains 'Value'
*/
/* data2 contains 'with'
*/
/* data3 contains 'Extra'
*/
/* data4 contains 'Variables.'
*/
/* data5 contains ''
*/
Parsing Data
Chapter 7. Manipulating Data
89
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......