Previous Topic: $ERRORPGM FunctionNext Topic: $ERRORSTMT Function


$ERRORPROC Function

This function returns the name of the procedure that contains the most recent error. Use this function with $ERROR‑PGM and $ERROR‑STMT to identify the line number, procedure, and statement number where the error occurred.

Note: $ERROR functions return meaningful data only in the error procedure or in a procedure or subprogram invoked by the error procedure. In the case of a database error, $ERROR functions can also return meaningful data in the scope of a WHEN ERROR clause. You do not have to pass the $ERROR functions as parameters.