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 */
DO i = 1 to numlines WHILE eof = 'NO'
"EXECIO 1 DISKRU updatedd" /* Queue the next line on the stack */
IFRC = 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
IFnewline = '' 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
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......