Capturing INVOKE Errors

Using an INVOKE statement can result in either an application error or an environment error. Application programming considerations for error handling are no different for invoking a transaction than for requesting one interactively.

Application Error Conditions

When a transaction activated by INVOKE encounters an application error, there is no special interaction with INVOKE itself. As an interface layer between processes, INVOKE is only moving data, not changing it. The first line following an INVOKE statement should be an error test, as in the following example.

INVOKE WS-TRANCODE USING "GLCM.1".
IF (NO-ERROR-FOUND)
    MOVE GLCMF1-TEXT-FLD1 TO GL80F1-TEXT-FLD1.

Environment Error Conditions

The following environment error conditions occur when INVOKE is unable to process a request normally:

  • The field CRT-ERROR-NBR returns with the value "999".

  • The field CRT-ERROR-MSG returns with a short string of descriptive text.

  • A separate log file containing additional information about the error can be created with this name:

    %LAWDIR%\system\joblog\lacob.nnnnnn

    where nnnnnn is the process ID.