Previous Topic: &APPC RECEIVE_AND_WAIT

Next Topic: &APPC RECEIVE_NOTIFY

&APPC RECEIVE_IMMEDIATE

&APPC RECEIVE_IMMEDIATE receives data sent from the remote conversation partner, if any is queued; otherwise returns to the procedure for processing to continue.

RECEIVE_IMMEDIATE indicates that this is an immediate conversation receive request. If data is available, it is returned on this request; otherwise the operation completes unsuccessfully.

This verb has the following format:

&APPC RECEIVE_IMMEDIATE
    [ ID=id ]
    [ MDO=mdoname [ MAP=mapname ]| VARS=var |
      VARS=(var1, var2, ..., varn ) |
      VARS=prefix* [ RANGE=(start,end) ] ]

Operands:

ID=id

Specifies the conversation identifier (as first returned by the system variable &ZAPPCID after successful allocation) that references a particular conversation. If this parameter is omitted, the current (last referenced, or only) conversation is assumed.

MDO=mdoname [ MAP=mapname ] | VARS=var |
VARS=( var1,var2,...,varn ) | VARS=prefix* [ RANGE=(start,end) ]

Mandatory-one of the options must be specified. It indicates how the incoming data should be formatted.

If MDO= is used, the data is formatted into an MDO with the name mdoname. If the incoming data is mapped (that is, a map name is sent with the data), and MAP= is not specified, then the received map name is used to connect to Mapping Services Mapping Support. If the incoming data is not mapped, then it is the requester's responsibility to connect to Mapping Services Mapping Support, if required, using the MAP operand.

The VARS= operand is used to provide the list of NCL variables that will contain the data received on the conversation (the usual NCL VARS definitions apply). If the incoming data is not mapped, or the map name is other than $NCL, then the data stream received is segmented into the variables nominated. If the data is mapped and the map name is $NCL, then each variable is reconstructed as it was on the send request in the conversation partner. Unused variables are set to null.

Example: &APPC RECEIVE_IMMEDIATE

&APPC RECEIVE_IMMEDIATE VARS=DATA

Return Codes:

The return codes are as follows:

0

Request successful

4

Request unsuccessful

8

Remote program error

12

State check

16

Request or conversation error

&ZFDBK is also set, plus all APPC system variables.

State Transition:

The RECEIVE_IMMEDIATE request is issued from receive state only and the conversation remains in receive state while the WHAT_RECEIVED indicator (&ZAPPCWR) contains DATA (that is, DATA_COMPLETE, DATA_TRUNCATED or DATA_INCOMPLETE).

If the WHAT_RECEIVED indicator contains SEND (where the remote conversation partner has issued PREPARE_TO_RECEIVE) the local state changes to send.

If the WHAT_RECEIVED indicator contains CONFIRM, CONFIRM_SEND, or CONFIRM_DEALLOCATE then the local procedure should issue the CONFIRMED request following which the state changes to receive, send, or deallocate respectively.

Notes:

Relationship to LU6.2 Verb Set:

&APPC RECEIVE_IMMEDIATE is equivalent to the LU6.2 verb MC_RECEIVE_IMMEDIATE.

More information:

&APPC Return Code Information

&RETCODE and &ZFDBK