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 #181 background imageLoading...
Page #181 background image
Updating Multiple Specific Lines in a Data Set
"ALLOC DA('dept5.employee.list') F(updatedd) OLD"
"EXECIO 1 DISKRU updatedd 2 (LIFO"
PULL line
PUSH 'Crandall, Amy AMY 5500'
"EXECIO 1 DISKW updatedd"
"EXECIO 1 DISKRU updatedd 5 (LIFO"
PULL line
PUSH 'Leone, Mary MARYL 5530'
"EXECIO 1 DISKW updatedd (FINIS"
"FREE F(updatedd)"
When you issue multiple EXECIO commands to the same data set before closing it
and do not specify a line number, the most current EXECIO command begins
reading where the previous one left off. Thus to scan a data set one line at a time
and allow a user at a terminal to update each line, you might write the following
exec.
Example of Scanning Each Line for Update
/***************************** REXX ********************************/
/* This exec scans a data set whose name and size are specified by */
/* a user. The user is given the option of changing each line as */
/* it appears. If there is no change to the line, the user presses*/
/* Enter key to indicate that there is no change. If there is a */
/* change to the line, the user types the entire line with the */
/* change and the new line is returned to the data set. */
/*******************************************************************/
PARSE ARG name numlines /* Get data set name and size from user */
"ALLOC DA("name") F(updatedd) OLD"
eof = 'NO' /* Initialize end-of-file flag */
DOi=1tonumlines WHILE eof = 'NO'
"EXECIO 1 DISKRU updatedd" /* Queue the next line on the stack */
IF RC = 2 THEN /* Return code indicates end-of-file */
eof = 'YES'
ELSE
DO
PARSE PULL line
SAY 'Please make changes to the following line.'
SAY 'If you have no changes, press ENTER.'
SAY line
PARSE PULL newline
IF newline = '' THEN NOP
ELSE
DO
PUSH newline
"EXECIO 1 DISKW updatedd"
END
END
END
Additional Examples
Using EXECIO to Process Information ...
Chapter 12. Processing Data and Input/Output Processing 163

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