IBM TSO/E REXX User Manual page 176

Table of Contents

Advertisement

Using EXECIO to Process Information ...
When you specify *, the EXECIO command will continue to pull items off the data
stack until it finds a null line. If the stack becomes empty before a null line is found,
EXECIO will prompt the terminal for input until the user enters a null line. Thus
when you do not want to have terminal I/O, queue a null line at the bottom of the
stack to indicate the end of the information.
QUEUE '
If there are null lines (lines of length 0) throughout the data and the data stack is
not shared, you can assign the built-in QUEUED() function to a variable to indicate
the number of items on the stack.
n = QUEUED()
"EXECIO" n "DISKW outdd (FINIS"
How to access the data set: An I/O data set must first be allocated to a ddname.
The ddname does not need to exist previously. In fact, it might be better to allocate
to a new ddname, such as MYOUTDD, in order not to interfere with previously
established allocations. You can allocate from within the exec with the ALLOCATE
command as shown in the following example, or you can allocate before the exec
runs.
"ALLOC DA(out.data) F(myoutdd) OLD REUSE"
"EXECIO * DISKW myoutdd ..."
Options for DISKW: Options you can use are:
v OPEN - To open a data set. When you specify OPEN with EXECIO 0, it opens
v FINIS - To close the data set after writing to it. Closing the data set allows other
v STEM - To write the information from compound variables or a list of variables
158
z/OS V1R1.0 TSO/E REXX User's Guide
the data set and positions the file position pointer before the first record.
"EXECIO 0 DISKW myoutdd (OPEN"
Note: If the data set is already open, no operation is performed for OPEN.
execs to access it and its ddname. When you specify FINIS, it forces the
completion of all I/O operations by physically writing the contents of any partially
filled I/O buffers to the data set.
"EXECIO * DISKW myoutdd (FINIS"
beginning with the name specified after the STEM keyword. The variables,
instead of the data stack, holds the information to be written.
"EXECIO * DISKW myoutdd (STEM newvar."
In this example, the variables would have the stem newvar. and lines of
information from the compound variables would go to the data set. Each variable
is labeled newvar.1, newvar.2, newvar.3, and so forth.
The variable newvar.0 is not used when writing from compound variables. When
* is specified with a stem, the EXECIO command stops writing information to the
data set when it finds a null value or an uninitialized compound variable. In this
case, if the list contained 10 compound variables, the EXECIO command stops
at newvar.11.
The EXECIO command can also specify the number of lines to write from a list
of compound variables.
"EXECIO 5 DISKW myoutdd (STEM newvar."
In this example, the EXECIO command writes 5 items from the newvar variables
including uninitialized compound variables, if any.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents