Execio Example 6 (Continued) - IBM TSO/E REXX User Manual

Table of Contents

Advertisement

EXECIO Example 6 (continued)

IF rc = 0 THEN
DO
SAY
SAY newvar.0 "records were written to 'all.sample.data'"
END
ELSE
DO
exec_RC = RC
SAY
SAY "Error during 1st EXECIO ... DISKW, return code is " RC
SAY
END
END
ELSE
DO
exec_RC = RC
SAY
SAY "Error during 1st EXECIO ... DISKR, return code is " RC
SAY
END
IF exec_RC = 0 THEN
DO
/***************************************************************/
/* At this time, the stem variables newvar.0 through newvar.20 */
/* will contain residual data from the previous EXECIO. We
/* issue the "DROP newvar." instruction to clear these residual*/
/* values from the stem.
/***************************************************************/
DROP newvar.
/***************************************************************/
/* Read all records from 'sample2.data' and append them to the */
/* end of 'all.sample.data'.
/***************************************************************/
"EXECIO * DISKR myindd2 (STEM newvar. FINIS" /*Read all records*/
IF rc = 0 THEN
DO
/*************************************************************/
/* At this point, newvar.0 should be 10, indicating 10
/* records have been read. Stem variables newvar.1, newvar.2,*/
/* ... through newvar.10 will contain the 10 records. If we */
/* had not cleared the stem newvar. with the previous DROP
/* instruction, variables newvar.11 through newvar.20 would */
/* still contain records 11 through 20 from the first data
/* set. However, we would know that these values were not
/* read by the last EXECIO DISKR since the current newvar.0 */
/* variable indicates that only 10 records were read by
/* that last EXECIO.
/*************************************************************/
Figure 8. EXECIO Example 6 (continued)
:
Using EXECIO to Process Information ...
/* If write was successful
/* Save exec return code
/* Save exec return code
/* If no errors so far... continue */
/* Set all stem variables to their
uninitialized state
/* If read was successful
Chapter 12. Processing Data and Input/Output Processing
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
169

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents