Receiving data by the buffer
Unlike the LLID option, the BUFFER option does not respect GDS record boundaries.
If the MAXFLENGTH value allows, bytes will be received for more than one record. A GDS RECEIVE command with the BUFFER option recovers the length of data specified in the MAXFLENGTH option, ignoring GDS record boundaries. CICS does not return control to the application program until this length of data has been received or the partner transaction sends the INVITE or LAST option.
Figure 1
shows the effect of the BUFFER option
on the same four RECEIVE commands discussed in
Receiving data by the record.
Figure 1. An example of the
effect of the BUFFER option. 
The data to be received consists
of two logical records:
- A GDS RECEIVE BUFFER command specifying MAXFLENGTH( maxfl1 ) is issued. This returns the first portion of the first record.
- A GDS RECEIVE BUFFER comand specifying MAXFLENGTH( maxfl2 ) is issued; because maxfl2 exceeds the length of the remaining data contained in the first logical record, the remaining data from the first record, and the first part of the second record (including the LL field), are returned.
- A GDS RECEIVE LLID command specifying MAXFLENGTH( maxfl3 ) is issued, where has a value of 2. Two further bytes from the second logical record are returned.
- A GDS RECEIVE LLID command specifying MAXFLENGTH( maxfl4 ) is issued, where maxfl4 exceeds the length of the remaining data in the second logical record. The application waits until the partner transaction sends either enough data to satisfy the RECEIVE request, or the INVITE or LAST option.
