OPM COBOL Error-Handling Exit Program


  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 Message text Input Char(*)
6 Length of passed message text Input Binary(4)
7 Return code Output Char(1)

This is a user-defined program that acts as an error handler for a COBOL/400® program. Use the Set COBOL Error Handler (QLRSETCE) 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. The list is variable in length and consists of uppercase letters in alphabetical order. The list always ends with a space.

Examples of lists of valid responses:

CG
CDFG

Name of program issuing error
INPUT; CHAR(20)

The qualified name of the 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.
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.

Message text
INPUT; CHAR(*)

The substitution text of the message, its length determined by Parameter 6.

Length of passed message text
INPUT; Binary(31)

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.


Exit Program Introduced: V3R2

[ Back to top | High-level language APIs | APIs by category ]