EasyManua.ls Logo

IBM TSO/E REXX - EXECIO Example 1; EXECIO Example 2

IBM TSO/E REXX
242 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
EXECIO Example 1
/***************************** REXX ********************************/
/* This exec reads from the data set allocated to INDD to find the */
/* first occurrence of the string "Jones". Upper and lowercase */
/* distinctions are ignored. */
/*******************************************************************/
done = 'no'
lineno = 0
DO WHILE done = 'no'
"EXECIO 1 DISKR indd"
IF RC = 0 THEN /* Record was read */
DO
PULL record
lineno = lineno + 1 /* Count the record */
IF INDEX(record,'JONES') \= 0 THEN
DO
SAY 'Found in record' lineno
done = 'yes'
SAY 'Record = ' record
END
ELSE NOP
END
ELSE
done = 'yes'
END
EXIT 0
Figure 1. EXECIO Example 1
EXECIO Example 2
/***************************** REXX ********************************/
/* This exec copies records from data set 'my.input' to the end of */
/* data set 'my.output'. Neither data set has been allocated to a */
/* ddname. It assumes that the input data set has no null lines. */
/*******************************************************************/
"ALLOC DA('my.input') F(indd) SHR REUSE"
"ALLOC DA('my.output') F(outdd) MOD REUSE"
SAY 'Copying ...'
"EXECIO * DISKR indd (FINIS"
QUEUE '' /* Insert a null line at the end to indicate end of file */
"EXECIO * DISKW outdd (FINIS"
SAY 'Copy complete.'
"FREE F(indd outdd)"
EXIT 0
Figure 2. EXECIO Example 2
Using EXECIO to Process Information ...
164
z/OS V1R1.0 TSO/E REXX Users Guide

Table of Contents

Related product manuals