Usage Notes
The Fetch Returned Data Length field specifies the length in bytes of the returned data.
Language | Variable Name |
---|---|
COBOL: | DBCAREA-FET-RET-DATA-LEN |
C: DBCAREA.H: | fet_ret_data_len |
Routine | Action Taken |
---|---|
DBCHINI: | writes |
DBCHCL: | writes (FET) |
Used by | Action Taken |
---|---|
application program | reads |
After a call to DBCHCL for the Fetch function, the application program can obtain the length of the returned data.
- If Locate Mode was set to N and Parcel Mode Fetch was set to Y and
- If Variable Length Fetch was set to N,
then, the length is in Fetch Returned Data Length; length is the length of the parcel body
- If Variable Length Fetch was set to Y,
then, the length is in first two bytes at address given in Fetch Data Pointer; length is the length of the parcel body
- If Variable Length Fetch was set to N,
- If Locate Mode was set to N and Parcel Mode Fetch was set to N and
- if Variable Length Fetch was set to N, then the length is in Fetch Returned Data Length; length is the length of the buffer copied into fet_data_ptr by CLI.
- if Variable Length Fetch was set to Y, then there is an error (this last option is not allowed).
- If Locate Mode was set to Y and Parcel Mode Fetch was set to Y and
- If Variable Length Fetch was set to N,
then, the length is in Fetch Returned Data Length; length is the length of the parcel body
- If Variable Length Fetch was set to Y,
then, the length is in first two bytes at address given in Fetch Data Pointer; length is the length of the parcel body
- If Variable Length Fetch was set to N,
- If Locate Mode was set to Y and Parcel Mode Fetch was set to N and
- If Variable Length Fetch was set to N,
then, the length is in Fetch Returned Data Length; length refers to the grand total of all parcels (headers and bodies) in the response buffer
- If Variable Length Fetch was set to Y,
then, there is an error (this last option is not allowed).
- If Variable Length Fetch was set to N,
In Move Mode only the length number of bytes are affected in the Move area. The bytes beyond are left “as is.”
DBCHCL places Fetch Returned Data Length, if used, in the DBCAREA when the Fetch function completes. Thus Fetch Data Pointer is available when the application program regains control with return code of zero from a call to DBCHCL for the Fetch function.