EasyManuals Logo
Home>IBM>Computer Hardware>TSO/E REXX

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #173 background imageLoading...
Page #173 background image
default. If you use EXECIO to read information from a data set and to a list of
variables, the first data set line is stored in variable1, the second data set line is
stored in variable2, and so on. Data read into a list of variables can be accessed
randomly. After the information is in the data stack or in a list of variables, the exec
can test it, copy it to another data set, or update it before returning it to the original
data set.
Reading Information from a Data Set
To read information from a data set to the data stack or to a list of variables, use
EXECIO with either the DISKR or DISKRU operand. A typical EXECIO command to
read all lines from the data set allocated to the ddname MYINDD, might appear as:
"EXECIO * DISKR myindd (FINIS"
The rest of this topic describes the types of information you can specify with
EXECIO DISKR and EXECIO DISKRU. For further information, see z/OS TSO/E
REXX Reference.
How to specify the number of lines to read: To open a data set without reading
any records, put a zero immediately following the EXECIO command and specify
the OPEN operand.
"EXECIO 0 DISKR mydd (OPEN"
To read a specific number of lines, put the number immediately following the
EXECIO command.
"EXECIO 25 ..."
To read the entire data set, put an asterisk immediately following the EXECIO
command.
"EXECIO * ..."
When all the information is on the data stack, either queue a null line to indicate the
end of the information, or if there are null lines throughout the data, assign the
built-in QUEUED() function to a variable to indicate the number of items on the
stack.
How to read the data set: Depending on the purpose you have for the input data
set, use either the DISKR or DISKRU operand.
v DISKR - Reading Only
To initiate I/O from a data set that you want to read only, use the DISKR operand
with the FINIS option. The FINIS option closes the data set after the information
is read. Closing the data set allows other execs to access the data set and the
ddname.
"EXECIO * DISKR ... (FINIS"
Note: Do not use the FINIS option if you want the next EXECIO statement in
your exec to continue reading at the line immediately following the last line
read.
v DISKRU - Reading and Updating
To initiate I/O to a data set that you want to both read and update, use the
DISKRU operand without the FINIS option. Because you can update only the last
line that was read, you usually read and update a data set one line at a time, or
go immediately to the single line that needs updating. The data set remains open
while you update the line and return the line with a corresponding EXECIO
DISKW command.
Using EXECIO to Process Information ...
Chapter 12. Processing Data and Input/Output Processing 155

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Related product manuals