Copying from Compound Variables
"ALLOC DA(new.data) F(outdd) LIKE(old.data) NEW"
"EXECIO 10 DISKW outdd (STEM NEWVAR."
Updating Information in a Data Set
You can update a single line of a data set with the EXECIO command, or you can
update multiple lines. Use the DISKRU form of the EXECIO command to read
information that you may subsequently update.
Note:
The line written must be the same length as the line read. When a changed
line is longer than the original line, information that extends beyond the
original number of bytes is truncated and EXECIO sends a return code of 1.
If lines must be made longer, write the data to a new data set. When a
changed line is shorter than the original line, it is padded with blanks to
attain the original line length.
Updating a single line:
When updating a single line in a data set, it is more
efficient to locate the line in advance and specify the update to it rather than read
all the lines in the data set to the stack, locate and change the line, and then write
all the lines back.
For example, you have a data set named 'DEPT5.EMPLOYEE.LIST' that contains a
list of employee names, user IDs, and phone extensions.
Adams, Joe
JADAMS
5532
Crandall, Amy
AMY
5421
Devon, David
DAVIDD
5512
Garrison, Donna
DONNAG
5514
Leone, Mary
LEONE1
5530
Sebastian, Isaac
ISAAC
5488
To change a phone extension to 5500 on a particular line, such as Amy Crandall’s,
specify the line number, in this case, 2, and write the following instructions. Notice
the "OLD" attribute on the allocation. The "OLD" attribute guarantees that no one
else can use the data set while you are updating it.
Updating a Specific Line 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 (FINIS"
"FREE F(updatedd)"
Updating multiple lines:
To update multiple lines, you can issue more than one
EXECIO command to the same data set. For example, to update Mary Leone’s
user ID in addition to Amy Crandall’s phone extension, write the following
instructions.
Using EXECIO to Process Information ...
162
z/OS V1R1.0 TSO/E REXX User’s Guide
Содержание 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: ......