SNAX/APC Application Programming Manual

Using the Application Program Interface
SNAX/APC Application Programming Manual138786
1-7
Qualified Opens
For TPs written in COBOL, the definition for the (MC)RECEIVE-AND-WAIT data
areas might be as follows:
01 MC-RWR-DATA-LENGTH PIC 9(4) COMP VALUE 0.
01 MC-RWR-DATA-AREA.
02 RWR-DATA-TEXT PIC X OCCURS 0 to N TIMES
DEPENDING ON RWR-DATA-LENGTH.
The DDL also describes how to create these definitions in COBOL and TAL.
The following example illustrates how TP programmers should use the definitions
provided in the SNAX/APC DDL:
SEND qualified-ipc-header
qualified-req-header
mc-receive-and-wait-req-parms TO ws-branch-bank
REPLY CODE 0, 2 YIELDS qualified-ipc-header
rep-header
mc-receive-and-wait-rep-parms
mc-rwr-data-length
mc-rwr-data-area
CODE 3 YIELDS qualified-ipc-header
ON ERROR PERFORM 4099-SEND-ERROR.
Qualified Opens
SNAX/APC supports qualified opens. A qualified open occurs when the TP opens
SNAX/APC and specifies an arbitrary, user-defined subdevice name in addition to the
SNAX/APC process name. For example, suppose the SNAX/APC process name is
$APC. Opening $APC.#TP1 would be a qualified open of the SNAX/APC process
$APC. SNAX/APC uses qualified opens to distinguish among different opens made by
the same TP.
Error Handling
A TP can detect and should handle three types of errors:
SNA communication errors, or SNAX/APN, SNAX/CDF, and SNAX/XF session
errors
SNAX/APC errors or conversation errors
User errors
Errors due to communication problems are usually detected by inspecting the RETN-
CODE field in the IPC reply message and the UOW-RETN-CODE field in the UOW
reply message. Other communication problems can be returned by the operating system
as file errors in response to WRITEREAD requests.
Protocol violation errors include logic errors and programming errors. Before
processing the individual verbs in an IPC message, SNAX/APC checks the parameters
Note. The request and reply portions are broken up so that each definition is used
separately. Use of this method is recommended.