IFERR (HLI function)
The conventions used on this page are described in Function call notation conventions.
Summary
- Description
- The IFERR call (ERROR) places an error message on the Model 204 journal.
- Thread type
- multiple cursor IFSTRT, single cursor IFSTRT
- IFCALL function number
- 28
Syntax
IFERR(RETCODE,PRINT_OP,ERR_MSG)
- Compile-only form
- Not available
- Execute-only form
- Not available
Specify the parameters in the syntax order shown above.
Parameter | Description |
---|---|
RETCODE | [O,i,r] The Model 204 return code is a required output parameter. The code is a binary integer value. |
PRINT_OP | [I,i,r] The print option is a required input parameter. Specify any of the following integer values for printing the message, or sum any of the values:
0 = Print the message only on the journal. 1 = Print the message on the operator's console and on the journal. 128 = Print the message on the journal and snap the current thread's storage areas including the Host Language Interface/Model 204 server area and control blocks. |
ERR_MSG | [I,c,r] The error message is a required input parameter that specifies the message to be printed. Specify a character string less than 256 characters in length. |
Usage notes
Use the IFERR call to document errors encountered during host language program processing. Model 204 writes the message in the journal as an AD line. You can use the IFERR call on any type of IFSTRT thread.
Coding example (COBOL)
In the example below, a message is written to the Model 204 journal.
WORKING-STORAGE SECTION. 01 CALL-ARGS. 05 RETCODE PIC 9(5) COMP SYNC. 05 AUDIT-ERROPT PIC 9(5) VALUE 0. . . . 01 MESSAGES. 05 MESSAGE-A PIC X(19) VALUE "INPUT CODE INVALID;". 05 MESSAGE-B PIC X(19) VALUE "RECORD NOT FOUND;". . . . PROCEDURE DIVISION. . . . CALL "IFERR" USING RETCODE, AUDIT-ERROPT, MESSAGE-B.