Chapter 7. Manipulating Data
Using Compound Variables and Stems . . . . . . . . . . . . . . . . 85
What is a Compound Variable? . . . . . . . . . . . . . . . . . . 85
Using Stems . . . . . . . . . . . . . . . . . . . . . . . . . 86
Exercises - Using Compound Variables and Stems
Parsing Data. . . . . . . . . . . . . . . . . . . . . . . . . . 87
Instructions that Parse . . . . . . . . . . . . . . . . . . . . . 88
PULL Instruction . . . . . . . . . . . . . . . . . . . . . . 88
ARG Instruction
. . . . . . . . . . . . . . . . . . . . . . 88
Ways of Parsing . . . . . . . . . . . . . . . . . . . . . . . 89
. . . . . . . . . . . . . . . . . . . . . . . . . . 89
String . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Variable
. . . . . . . . . . . . . . . . . . . . . . . . . 90
. . . . . . . . . . . . . . . . . . . . . . . . . 90
Parsing Multiple Strings as Arguments . . . . . . . . . . . . . . . 92
Exercise - Practice with Parsing
. . . . . . . . . . . . . . . . 92
This chapter describes how to use compound variables and stems, and shows
various ways of parsing using templates.
Using Compound Variables and Stems
Sometimes it is useful to store groups of related data in such a way that the data
can be easily retrieved. For example, a list of employee names can be stored in an
array and retrieved by number. An array is an arrangement of elements in one or
more dimensions, identified by a single name. You could have an array called
employee
that contains names as follows:
EMPLOYEE
(1) Adams, Joe
(2) Crandall, Amy
(3) Devon, David
(4) Garrison, Donna
(5) Leone, Mary
(6) Sebastian, Isaac
In some computer languages, you access an element in the array by the number of
the element, such as, employee(1), which retrieves Adams, Joe. In REXX, you use
compound variables.
What is a Compound Variable?
Compound variables are a way to create a one-dimensional array or a list of
variables in REXX. Subscripts do not necessarily have to be numeric. A compound
variable contains at least one period with characters on both sides of it. The
following are examples of compound variables.
FRED.5
Array.Row.Col
employee.name.phone
The first variable in a compound variable always remains a symbol with no
substitution. The remaining variables in a compound variable take on values
previously assigned. If no value was previously assigned, the variable takes on the
uppercase value of the variable name.
© Copyright IBM Corp. 1988, 2001
85
Содержание 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: ......