Writing Information To A Data Set - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

To avoid confusion as to whether a residual stem variable value is meaningful,
you may want to clear the entire stem variable prior to entering the EXECIO
command. To clear all stem variables, you can either:
– Use the DROP instruction as follows, which sets all stem variables to their
uninitialized state.
DROP newvar.
– Set all stem variables to nulls as follows:
newvar. = '
See EXECIO Example 6 under the heading Figure 7 on page 168, which shows
the usage of the EXECIO command with stem variables.
v SKIP - To skip over a specified number of lines in a data set without placing them
on the data stack or into variables.
"EXECIO 24 DISKR myindd (SKIP"
v LIFO - To read the information in LIFO order onto the stack. In other words, use
the PUSH instruction to place the information on the stack.
v FIFO - To read the information in FIFO order onto the stack. In other words, use
the QUEUE instruction to place the information on the stack. If you do not specify
either LIFO or FIFO, FIFO is assumed.

Writing Information to a Data Set

To write information to a data set from the data stack or from a list of variables, use
EXECIO with the DISKW operand. A typical EXECIO command to write all lines to
the data set allocated to the ddname, MYOUTDD, might appear as:
"EXECIO * DISKW myoutdd (FINIS"
The rest of this topic describes the types of information you can specify with
EXECIO DISKW. For further information, see z/OS TSO/E REXX Reference.
How to specify the number of lines to write: To open a data set without writing
records to it, put a zero immediately following the EXECIO command and specify
the OPEN operand.
"EXECIO 0 DISKW myoutdd ... (OPEN"
Notes:
1. To empty a data set, issue this command to open the data set and position the
file position pointer before the first record. You then issue EXECIO 0 DISKW
myoutdd ... (FINIS to write an end-of-file mark and close the data set. This
deletes all records in data set MYOUTDD. You can also empty a data set by
issuing EXECIO with both the OPEN and FINIS operands.
2. When you empty a data set, the file to which the data set is allocated should
not have a disposition of MOD. If the file has a disposition of MOD, opening and
then closing the data set will not empty the data set.
To write a specific number of lines, put the number immediately following the
EXECIO command.
"EXECIO 25 DISKW ..."
To write the entire data stack or until a null line is found, put an asterisk
immediately following the EXECIO command.
"EXECIO * DISKW ..."
Using EXECIO to Process Information ...
Chapter 12. Processing Data and Input/Output Processing
157

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents