TS/MP Management Programming Manual (G06.24+, H06.03+)

NonStop TS/MP Management Programming Manual540082-001
17-1
17
Error Handling Example Program
This example management program decodes a Pathway subsystem SPI error list. It is
written in COBOL.
The program:
1. Obtains and interprets the ZSPI-TKN-RETCODE token and selects a table based
on the range of ZSPI-TKN-RETCODE. For information on the ZSPI-TKN-
RETCODE token, see the SPI Programming Manual.
2. Locates and displays the error message text.
3. After opening the error list, decodes and displays the value of these error tokens:
ZPWY-TKN-REQCOMMAND
ZPWY-TKN-REQOBJECTTYPE
ZPWY-TKN-REQnnnNAME
ZSPI-DDL-PARM-ERR
ZPWY-TKN-ERROBJECTTYPE
ZPWY-TKN-nnnNAME
ZPWY-TKN-ERRINFO
The error tables are created by defining records that contain the text for each error
message, one record for each of the three categories of Pathway subsystem errors
(that is, errors returned by PATHMON, TCP, and SPI). The program then redefines
each record as a table, with an occurrence for each error message.
The source files used in this example are ZSPICOB, which contains SPI/DSM COBOL
definitions, and ZPWYCOB, which contains Pathway/DSM COBOL definitions. The
object file used is COBOLEX0, which contains C00 operating system procedure call
formats.
H
Example 17-1. Handling Errors (page 1 of 26)
IDENTIFICATION DIVISION.
PROGRAM-ID. PATHWAY-SPI-ERROR.
?CONSULT COBOLEX0
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MISCELLANEOUS.
05 WS-SS-RESULT NATIVE-2 VALUE -1.
05 WS-SPI-RESULT NATIVE-2 VALUE -1.
05 WS-FIRST-OCCURRENCE PIC S9(4) COMP VALUE 1.
05 WS-REQUEST.
10 COMMAND NATIVE-2 VALUE -1.
10 OBJECT-TYPE NATIVE-2 VALUE -1.
10 OBJECT-FLAG PIC S9(4) COMP VALUE 0.
88 OBJECT-HAS-NO-NAME VALUE 0.
88 OBJECT-HAS-NAME VALUE 1.
10 REQ-NAME-TKN NATIVE-4.