When the value for Variable-length-fetch is not appropriate for the application, you should perform the following procedure before calling DBCHCL for Connect, RunStartUp, Command, Initiate with Protocol-function, or Initiate Request:
- Set Change-options to 'Y'.
- Change the value for Variable-length-fetch as follows.
If the length information is to... Then change the value for Variable-length-fetch to... precede immediately the string to which it applies Y be supplied separately from the string to which it applies N
For a parcel of data made available by DBCHCL from the response, DBCHCL supplies to the application both the length and the address of the data.
If Variable-length-fetch is set to this value... Then the address in Fetch-data-pointer points to... N the beginning of the parcel body and the length of the parcel body is supplied separately in Fetch-returned-data-length. Y a two-byte length (in binary) field that precedes the parcel body, and the length of the parcel body is not supplied in Fetch-returned-data-length.
You can set Variable-length-fetch to ‘Y‘ only if Parcel-mode-fetch is set to ‘Y‘.
If the Maximum-parcel option is set to H, then the two-byte length is considered to be an unsigned value. Because PL/I does not support unsigned integers, you cannot use the Variable-length-fetch option to allow the PL/I VARYING attribute for the Fetch-data-pointer for responses greater than 32767.
Since the maximum value that can be contained in the two-byte length is 65535, responses with Variable-length-fetch that require larger lengths will be rejected.