with the OUTTRAP external function when trapping command output. For
information about OUTTRAP, see “Using the OUTTRAP Function” on page 123.
Exercises - Using Compound Variables and Stems
1. After these assignment instructions, what is displayed in the following SAY
instructions?
a = 3 /* assigns '3' to variable 'A' */
b = 4 /* '4' to 'B' */
c = 'last' /* 'last' to 'C' */
a.b = 2 /* '2' to 'A.4' */
a.c = 5 /* '5' to 'A.last' */
x.a.b = 'cv3d' /* 'cv3d' to 'X.3.4' */
a. SAY a
b. SAY B
c. SAY c
d. SAY a.a
e. SAY A.B
f. SAY b.c
g. SAY c.a
h. SAY a.first
i. SAY x.a.4
2. After these assignment instructions, what is displayed?
hole.1 = 'full'
hole. = 'empty'
hole.s = 'full'
a. SAY hole.1
b. SAY hole.s
c. SAY hole.mouse
ANSWERS
1.
a. 3
b. 4
c. last
d. A.3
e. 2
f. B.last
g. C.3
h. A.FIRST
i. cv3d
2.
a. empty
b. full
c. empty
Parsing Data
Parsing in REXX is separating data into one or more variable names. An exec can
parse an argument to break it up into smaller parts or parse a string to assign each
word to a variable name. Parsing is also useful to format data into columns.
Using Compound Variables and Stems
Chapter 7. Manipulating Data 87