IBM OS/390 Time Clock User Manual


 
When updating records, it is convenient to use the list and execute forms of
READ/WRITE macros rather than the standard forms and to request dynamic
buffering. To update a direct access file that was created sequentially, as in
Figure 51 on page 325, use coding similar to that of the example in Figure 44 on
page 318, which uses the list and execute forms of the READ and WRITE macros.
The key does not need to be rewritten after a record has been retrieved and
updated, so the key address field is specified as zero. You must specify BUFL
because dynamic buffering was requested.
.
.
OPEN DAMFILE,TAPE
GETTAPE GET TAPE
.
.
WRITE DAMFILE,ID
WAITF DAMFILE
.
.
CLOSE DAMFILE,TAPE
TAPE DTFMT
MTMOD
DAMFILE DTFDA BLKSIZE=50,DEVICE=3340,DSKXTNT=3, C
ERRBYTE=ERROR,IOAREA1=OUTPUT, C
SEEKADDR=ADDR,TYPEFLE=OUTPUT, C
RELTYPE=HEX,VERIFY=YES,WRITEID=YES
DAMOD ERREXT=YES,RELTRK=YES
Figure 51. Loading a Random (Preformatted) DAM File under VSE
Multiple Search / Feedback
Under VSE, if you have specified SRCHM=YES, READ or WRITE KEY and
IDLOC=xxxxxxxx, the system returns to you the address of the record currently
being read or written. This address is placed in the field specified by IDLOC. VSE
supplies the ID in the same form used in the SEEKADR location, except when
physical IDs are involved. In that case, only the last five bytes of the physical ID,
cchhr, are supplied instead of the complete relative ID including zeros.
If you use READ or WRITE ID (or READ or WRITE KEY without SRCHM), VSE
returns the address of the next record. This address is placed in the field
specified by IDLOC. When using relative addressing with IDLOC, all your extents,
except the last extent for each file, should end on cylinder boundaries.
Under MVS, if the data set was created using relative track, key,. and extended
search, you may request feedback to increase the speed of an update run.
Feedback means that after the execution of a READ/WRITE macro, the address of
the retrieved record is supplied by the system in the field specified by
blockaddress.
Thus, if a READ requires an extended search over several tracks to locate a
specific record by its key, the subsequent update WRITE may use the address
supplied by the feedback option rather than repeat the entire search.
Chapter 13. Assembler 325