Receiving data by the record
If you specify the LLID option on a GDS RECEIVE command, the data is considered as a series of GDS records. On each GDS RECEIVE request, data is received from not more than one record.
If the record is longer than the value specified in the MAXFLENGTH
option, two or more RECEIVE commands are required to recover the
whole
record. CDBCOMPL is set on when the end of a GDS record has been
received. Consider the example shown in
Figure 1.
Figure 1. An example
of the effect of the LLID option. 
The first RECEIVE command receives the front portion of the
first record. The length received is restricted by the MAXFLENGTH
value (MAXFL1). The second RECEIVE command receives the rest of the
first logical record. Even though the MAXFLENGTH value (MAXFL2) allows
more data to be received, this cannot be done without breaking the
LL boundary rule. The third RECEIVE command is for two bytes of data
(the LL field). The fourth RECEIVE command receives the rest of the
second record.
The data to be received
consists of two logical records:
- A GDS RECEIVE LLID command specifying MAXFLENGTH( maxfl1 ) is issued. This returns the first portion of the first record. CDBCOMPL is set to X'00' , indicating that a complete record has not been received.
- A GDS RECEIVE LLID 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 record is returned. CDBCOMPL is set to X'FF' , indicating that a complete record has been received.
- A GDS RECEIVE LLID command specifying MAXFLENGTH( maxfl3 ) is issued, where has a value of 2. The LL field from the second logical record is returned. CDBCOMPL is set to X'00' , indicating that a complete record has not been received.
- A GDS RECEIVE LLID command specifying MAXFLENGTH( maxfl4 ) is issued, where maxfl4 is the length of the remaining data in the second logical record. CDBCOMPL is set to X'FF' , indicating that a complete record has been received.

The application can tell if a complete record has been received, because CDBCOMPL is set ( X'FF' ). In the example given, CDBCOMPL is set on after the second and fourth RECEIVE commands. CDBCOMPL is set off ( X'00' ) after the first and third RECEIVE commands.