Chapter 12. Processing Data and Input/Output Processing
Types of Processing ......................153
Dynamic Modification of a Single REXX Expression ...........153
Using the INTERPRET Instruction ................153
Using EXECIO to Process Information to and from Data Sets .......154
When to Use the EXECIO Command ...............154
Using the EXECIO Command ..................154
Reading Information from a Data Set ..............155
Writing Information to a Data Set ................157
Return Codes from EXECIO ..................159
When to Use the EXECIO Command ...............159
Copying Information From One Data Set to Another .........159
Copying Information to and from a List of Compound Variables.....161
Updating Information in a Data Set ...............162
Additional Examples ....................163
This chapter describes dynamic modification of a single REXX expression and I/O
processing of data sets.
Types of Processing
The word "processing" is used here to mean the performance of operations and
calculations on data. Normal processing of instructions in REXX occurs every time
the language processor evaluates an expression. This chapter describes two
special types of REXX processing:
v Dynamic modification of a single REXX expression
The INTERPRET instruction evaluates an expression and then treats it as a
REXX instruction.
v Processing information to and from data sets
The TSO/E REXX EXECIO command in an exec reads information from a data
set to the data stack (or a list of variables) and writes information from the data
stack (or list of variables) back to a data set.
Dynamic Modification of a Single REXX Expression
Typically REXX expressions are evaluated and the result replaces the expression.
For example, the arithmetic expression "5 + 5" is evaluated as "10".
answer=5+5 /*answer gets the value 10 */
If the arithmetic expression is in quotation marks, the expression is evaluated as a
string.
answer = '5 + 5' /* answer gets the value 5 + 5 */
To both evaluate and execute an expression, you can use the INTERPRET
instruction.
Using the INTERPRET Instruction
The INTERPRET instruction not only evaluates an expression, but also treats it as
an instruction after it is evaluated. Thus if a combination of the previous examples
were used with the INTERPRET instruction, answer becomes "10".
© Copyright IBM Corp. 1988, 2001 153