SNAX/APC Application Programming Manual
Interprocess Communications and Units of Work
SNAX/APC Application Programming Manual—138786
2-3
IPC Message Structure
For example, a single IPC message might contain the UOWs ALLOCATE, SEND-
DATA, SEND-DATA, and CONFIRM. In this example, these four UOWs are issued and
completed in a single WRITEREAD procedure call.
Although you have the ability to enclose multiple UOWs in a single IPC message, you
should nevertheless be careful in your choice of UOWs. For example, including a
DEALLOCATE in the same UOW as an (MC)RECEIVE-AND-WAIT would cause
unexpected results. If SNAX/APC continues to process DEALLOCATE after
(MC)RECEIVE-AND-WAIT completes with a return code of 1005 (DEALLOCATE
NORMAL), SNAX/APC might have trouble in formatting an IPC reply because control
blocks have been released. Although it is possible to include more than one
(MC)RECEIVE-AND-WAIT in an IPC, you are advised to check the return code and
the WHAT-RECEIVED field before issuing the next verb request. This implies that if a
(MC)RECEIVE-AND-WAIT exists in the IPC, it should be the last UOW in that IPC
message.
UOWs consist of requests sent to SNAX/APC or replies from SNAX/APC (see
Figure 2-3
). The request consists of a header and a verb (mapped or basic) plus that
verb’s parameters. The reply consists of a header, verb code, and a return code from
SNAX/APC. Return code details may also be included.
TPs written in TAL or C communicate with SNAX/APC using the WRITEREAD
procedure. The WRITE portion of the WRITEREAD contains a request to SNAX/APC,
and the READ portion contains the reply for the requested operation.
TPs written in COBOL communicate with SNAX/APC using the READ statement with
the WITH PROMPT phrase. The prompt string contains the verb request; the
destination variable contains the reply.
TPs written in SCREEN COBOL communicate with SNAX/APC using the SEND
statement or the SEND MESSAGE statement, both of which have an implicit reply.
Figure 2-2. IPC Message Structure
Figure 2-3. UOW Structures
013CDT .CDD
IPC
Header
UOW UOW UOW
014CDT .CDD
Reply
UOW ID
Verb Code
Return
Code
RC Detail
Request
UOW ID
Verb Code Parm 1 Parm 2
• • •• • •
• • •• • •