Using Stems - IBM SC34-5764-01 Manual

Cics transaction server for vse/esa
Table of Contents

Advertisement

Manipulating Data
DO i = 1 TO 6
PARSE PULL employee.i
END
If you use the same names used in the example of the employee array, you have a group of compound
variables as follows:
employee.1 = 'Adams, Joe'
employee.2 = 'Crandall, Amy'
employee.3 = 'Devon, David'
employee.4 = 'Garrison, Donna'
employee.5 = 'Leone, Mary'
employee.6 = 'Sebastian, Isaac'
After the names are in the group of compound variables, you can easily access a name by its number or
by a variable that represents its number.
name = 3
SAY employee.name
/* Produces 'Devon, David' */
For more information about compound variables, see section "Compound Symbols" on page 122.

Using Stems

When working with compound variables, it is often useful to initialize an entire collection of variables to the
same value. You can do this easily by using an assignment that includes a stem. For example, number.=0
initializes all array elements in the array named number. to 0.
You can change the values of all compound variables in an array the same way. For example, to change
all employee names to Nobody, use the following assignment instruction:
employee. = 'Nobody'
As a result, all compound variables beginning with the stem employee., previously assigned or not, have
the value Nobody. After a stem assignment, you can assign individual compound variables new values.
employee.='Nobody'
SAY employee.5
SAY employee.10
SAY employee.oldest
employee.new = 'Clark, Evans'
SAY employee.new
You can use stems with the EXECIO and RFS commands when reading to and writing from a file. See
section "EXECIO" on page 344 for information about EXECIO. See section "RFS" on page 363 for
information about RFS. RFS is the preferred I/O method under CICS.
Exercises - Using Compound Variables and Stems
1. After these assignment instructions, what do the following SAY instructions produce?
a = 3
/* assigns '3' to variable 'A' */
d = 4
/*
c = 'last'
/*
a.d = 2
/*
a.c = 5
/*
z.a.d = 'cv3d' /*
a.
SAY a
b.
SAY D
c.
SAY c
d.
SAY a.a
e.
SAY A.D
f.
SAY d.c
g.
SAY c.a
72
CICS TS for VSE/ESA: REXX Guide
/* Produces 'Nobody' */
/* Produces 'Nobody' */
/* Produces 'Nobody' */
/* Produces 'Clark, Evans' */
'4' to
'D' */
'last' to
'C' */
'2' to
'A.4' */
'5' to
'A.last' */
'cv3d' to
'Z.3.4' */

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rexx

Table of Contents