NetBatch Management Programming Manual

SPI Programming Considerations for the NetBatch
Subsystem
NetBatch Management Programming Manual522462-003
3-7
Receiving and Decoding a Response Message
Receiving and Decoding a Response Message
To receive and decode a response message from the NetBatch subsystem:
1. Declare a buffer of appropriate size. NetBatch buffer declarations are:
For more information on NetBatch buffer declarations, see Section 4, Common
Definitions.
2. Read the response message using the mechanism applicable to your
programming language (for example, Guardian procedure WRITEREADX for C
and TAL, the READ verb for COBOL, or the #REQUESTER built-in function for the
TACL program).
3. Call procedure SSGET or SSGETTKN to extract tokens and related information
from the buffer.
4. Call procedure SSMOVE or SSMOVETKNif the buffer contains the ZSPI-TKN-
CONTEXT tokento copy the context token into the original command buffer, and
resend the command to get the next message in the response or to complete the
command.
5. Take action appropriate to the information in the response.
The NetBatch subsystem returns multiple response records in its responses to some
commands, as described in the SPI Programming Manual.
Error Handling
Each NetBatch subsystem response includes a return token (ZSPI-TKN-RETCODE)
whose value indicates whether an error occurred when the subsystem tried to perform
the command. If the command completed with no errors, the value of the return token
is zero. Some NetBatch error replies contain information about the error, in addition to
the error number in ZSPI-TKN-RETCODE. This additional information is enclosed in an
SPI error list (ZSPI-TKN-ERRLIST) and does not use extensible structured tokens.
If the value of ZSPI-TKN-RETCODE is not zero, the command might have failed.
Where a nonzero return code is present, the response buffer might contain one or
more error lists. Even if the return code is zero, the response might still contain error
lists that describe warnings. A warning reports a condition less serious than an error. If
no errors occurred but a warning did occur, an error list appears in the response,
providing information about the warning condition.
Your applications must always check error lists, regardless of the RETCODE values.
Buffer Declaration Buffer Size
ZBAT-DDL-MSG-BUFFER ZBAT-VAL-BUFLEN (2042 bytes)
ZBAT-DDL-MSG-BUFFER-MAX ZBAT-VAL-BUFLEN-MAX (4090 bytes)
ZBAT-DDL-MSG-BUFFER-MIN ZBAT-VAL-BUFLEN-MIN (1018 bytes)