IFERR (HLI function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with " ==Summary== <dl> <dt>Description</dt> <dd>The IFERR call (ERROR) places an error message on the Model 204 journal.</dd> <dt>Thread type</dt> <dd>multiple cursor IFSTRT, singl...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
The conventions used on this page are described in [[HLI: Function summary#Function call notation conventions|Function call notation conventions]].


==Summary==
==Summary==

Latest revision as of 22:51, 12 July 2016

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.