Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 8: switch from direct to sequential retrieval z/OS DFSMS Macro Instructions for Data Sets SC23-6852-02 |
|
In this example, GET macros are used to retrieve fixed-length,
100-byte records. The retrieval is by means of an alternate index
path defined with the non-unique key option. Every time a non-unique
key is retrieved, the program switches to sequential processing to
retrieve the other records with the same key. The control blocks were
generated at assembly, but the MODCB macro is used to modify the request
parameter list to permit switching from keyed-direct to keyed-sequential
retrieval. For the direct request preceding sequential requests, the
search argument is an 8-byte, generic key, compared equal. Positioning
is requested for direct requests.
Positioning is associated with a request parameter list; the MODCB macro modifies a single request parameter list that alternately defines requests for both types of access rather than using a different request parameter list for each type. With direct retrieval, VSAM does not remember its position for subsequent sequential retrieval unless you explicitly request it (OPTCD=NSP or UPD). After a direct GET for update, VSAM is positioned for a subsequent PUT, ERASE, or sequential GET. If you modify OPTCD=(DIR,NUP) to OPTCD=SEQ, you must issue POINT to get VSAM positioned for sequential retrieval, as NUP indicates that no positioning is desired with a direct GET. If you have chained many request parameter lists together, one position is remembered for the whole chain. For example, if you issue a GET that gives the address of the first request parameter list in the chain, the position of VSAM when the GET request is complete is at the record following the record defined by the last request parameter list in the chain. Therefore, modifying OPTCD=(DIR,NSP) in each request parameter list in a chain to OPTCD=SEQ implies continuing with sequential access relative to the last of the direct request parameter lists. |
Copyright IBM Corporation 1990, 2014
|