ILE COBOL Error-Handling Exit Procedure


  Required Parameter Group:

1 COBOL message identification Input Char(7)
2 Valid responses to message Input Char(6)
3 Name of program issuing error Input Char(20)
4 System message causing COBOL message Input Char(7)
5 Length of passed message text Input Binary(4)
6 Return code Output Char(1)
7 Message text Input Char(*)
8 Module name Input Char(10)
9 COBOL program name Input Char(256)

This is a user-defined program that acts as an error handler for an ILE COBOL/400 program. Use the Set COBOL Error Handler (QlnSetCobolErrorHandler) API to establish this relationship between the two programs.


Authorities and Locks

None.


Required Parameter Group

COBOL message identification
INPUT; CHAR(7)

A 3-character prefix followed by a 4-character number.

Valid responses to message
INPUT; CHAR(6)

The list of valid 1-character responses. This list is variable in length and consists of uppercase letters in alphabetical order. The list always ends with a space.

The following are examples of lists of valid responses:

CG  
CDFG  

Name of program issuing error
INPUT; CHAR(20)

The qualified name of the ILE COBOL/400 program that issued the error.

The 20 characters of this parameter are:

1-10 The name of the program object.
The valid value is:
program-name The name of the program object.

11-20 The library where the program object existed.
The valid value is:
library-name The library where the program object existed.


System message causing COBOL message
INPUT; CHAR(7)

Some COBOL error messages are issued because of error messages received from the system. This parameter identifies such system messages.

Valid values are:

*NONE No system message is available.
message-id A 3-character message prefix followed by a 4-character number.

Length of passed message text
INPUT; BINARY(4)

If the original message was a system message, the substitution text for the system message is passed. In the absence of an original system message, Parameter 4 has a value of *NONE, and the substitution text for the COBOL message is passed.

Return code
OUTPUT; CHAR(1)

Must be one of the values specified in Parameter 2, or a space. If the value is not one of these, a response of a space is assumed.

Valid values are:

blank Issue the COBOL message that was passed to the error-handling program.
G Continue running the COBOL program.
C End the current COBOL run unit.
D Same as C, but produce a formatted dump of user-defined COBOL variables.
F Same as D, but also dump COBOL's file-related internal variables.

Message text
INPUT; CHAR(*)

The substitution text of the message. Its length is determined by Parameter 5.

Module name
INPUT; CHAR(10)

The module within the program object that issued the error.

COBOL program name
INPUT; CHAR(256)

The name of the COBOL program, from the PROGRAM-ID paragraph, that issued the error.


Exit program introduced: V3R2
Top | High-level language APIs | APIs by category