skip to main content

Library Routines : CBL_ERROR_PROC

CBL_ERROR_PROC
The CBL_ERROR_PROC library routine installs or removes error procedures to be called automatically if and when the current run unit generates any of certain runtime errors. This implementation calls error procedures only when a run unit generates what is called an intermediate runtime error.
In order to receive the error information, the error procedure program should include the following Linkage Section parameter:
       LINKAGE SECTION.
       77 ERROR-DESC PIC X(325
       PROCEDURE DIVISION USING ERROR-DESC.
Note: only errors of the kind java.lang.Exception cause the error procedure to be invoked. This kind of exception is raised for most of the COBOL errors though.
Syntax:
 CALL "CBL_ERROR_PROC" USING installFlag 
Parameters:
Return code:
statusCode can be any numeric data item and it is always zero.
Examples:
Example - Use a specific program to catch runtime errors during the execution of a program, disable it at the end
   call "cbl_error_proc" using 0"myerrtrap".
   call "cbl_error_proc" using 1"myerrtrap"
   goback.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left