Parsing Data; Exercises - Using Compound Variables And Stems - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

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
2. After these assignment instructions, what is displayed?
ANSWERS
1.
2.

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.
instructions?
a = 3
b = 4
c = 'last'
a.b = 2
a.c = 5
x.a.b = 'cv3d'
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
hole.1 = 'full'
hole. = 'empty'
hole.s = 'full'
a.
SAY hole.1
b.
SAY hole.s
c.
SAY hole.mouse
a.
3
b.
4
c.
last
d.
A.3
e.
2
f.
B.last
g.
C.3
h.
A.FIRST
i.
cv3d
a.
empty
b.
full
c.
empty
Using Compound Variables and Stems
/* assigns '3' to variable 'A' */
/*
'4' to
/*
'last' to
/*
'2' to
/*
'5' to
'A.last' */
/*
'cv3d' to
Chapter 7. Manipulating Data
'B' */
'C' */
'A.4' */
'X.3.4' */
87

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents