How to Calculate Addresses and Values
Upon entry into the user-written allocation exit, register 1 contains the address of a standard parameter list. The first entry in the PLIST contains the address of the VSAMPL. The second entry in the PLIST contains the address of the SQCB, if available. The VSCCBADR field in the VSAMPL contains the address of the Process step header, TCQSH. The SDESCR and DDESCR following the TCQSH is found by adding displacements to the TCQSH address.
- To calculate the location of SDESCR, add the length of TCQSH (TSHCBHLN) to the TCQSH address (VSCCBADR).
- To calculate the location of DDESCR, add the length of SDESCR (S1SVSLNG) to the SDESCR address.
All displacement values in the Copy control block are referenced from the beginning of the TCQSH control block.
SDESCR and DDESCR contain both fixed length fields and offsets to variable length fields. The allocation exit modifies any fixed length field in DDESCR.
The fields that are referenced in SDESCR and DDESCR using displacement values are variable in length. Do not modify them with the allocation exit.
The DSN field is created with enough space to hold a 100-character name only if the TSEXPDSN bit is on (set) in the TCQSH. If the TSEXPDSN bit is off in the TCQSH, then the Copy control block does not contain the room to expand the DSN. This lack of expansion room means that this copy originated from a IBM® Connect:Direct® node that did not build the copy control block with an expandable DSN field.
You can find the DSN field by adding D1DDSN to the address of the TCQSH. The DSN field contains a 2-byte length field followed by the DSN. Even though the field can be up to 100 bytes long, the 2-byte length field contains the actual length of the DSN. If you change the length of the DSN, you must modify the 2-byte length field accordingly. The other variable length fields are created with their current values and cannot be lengthened. Do not modify the D1DDSN field.
When allocating the destination file, IBM Connect:Direct first uses values from DDESCR, as specified in the IBM Connect:Direct COPY statement. Any values needed, but not set in DDESCR, are taken from the Type record, if one was specified. Any remaining values are taken from the SDESCR portion of the copy control block.