Command completion

The FEPI RECEIVE command completes on ‘end of chain’.

This normally coincides with ‘change direction’ or ‘end bracket’, meaning that all data has been received. In some cases, however, back-end applications may send data to you in several sections (chains), each causing a screen update, so you must keep on receiving data until ‘change direction’ or ‘end bracket’ is indicated.

In all cases, the ENDSTATUS option is set to indicate what the completion conditions were. Where several conditions occur together, ENDSTATUS shows the most significant one. The values of ENDSTATUS and their associated meanings are shown in Table 1.
Table 1. ENDSTATUS values and associated meanings for formatted data
ENDSTATUS End bracket Change direction End of chain Next command expected
EB Y - Y Any
CD - Y Y FEPI SEND or CONVERSE
LIC - - Y FEPI RECEIVE
Note: Y=Condition indicated.

When ‘end bracket’ is received, the session is in contention state , and either end may try to transmit data next. Some back-end systems use ‘end bracket’ in the middle of a series of transmissions to allow the terminal to break in if it wants, and they may use ‘end bracket’ instead of ‘change direction’ at the end of the flow. This is particularly true of IMS. CICS® usually sends ‘change direction’ eventually, although it may send ‘end bracket’ indicators intermediately.

Using your knowledge of the back-end application and system, you must check the data that you have already received, to determine whether more data is to be expected or the transmission is complete. If more data is expected, you should issue another FEPI RECEIVE command; if the transmission is complete, it is the front-end application’s turn to send data.

You should always use the TIMEOUT option on a FEPI RECEIVE command; see timeouts.