Skip to main content

Handling Abnormal Terminations (ABNDPROC)

The ABNDPROC program is responsible for handling abnormal terminations (ABENDs) in the system. It logs ABEND records to a VSAM file named ABNDFILE. The program starts by displaying a message indicating its initiation, processes the data passed through DFHCOMMAREA, writes the data to ABNDFILE, checks the write response, and finally returns control to CICS.

The ABNDPROC program starts by displaying a start message, then it processes the data passed to it, writes this data to a file, checks if the write was successful, and finally returns control to the system.

Lets' zoom into the flow:


Display 'Started ABNDPROC:'

First, the program displays the message 'Started ABNDPROC:' to indicate the start of the ABNDPROC process.

      D    DISPLAY 'Started ABNDPROC:'.


Display 'COMMAREA passed='

Next, it displays the contents of DFHCOMMAREA to show the data passed to the program.

      D    DISPLAY 'COMMAREA passed=' DFHCOMMAREA.


Move DFHCOMMAREA to WS-ABND-AREA

Then, the contents of DFHCOMMAREA are moved to WS-ABND-AREA for further processing.

           MOVE DFHCOMMAREA TO WS-ABND-AREA.


Write to ABNDFILE

The program writes the contents of WS-ABND-AREA to the VSAM file ABNDFILE. This step is crucial for logging the ABEND record.

           EXEC CICS WRITE
FILE('ABNDFILE')
FROM(WS-ABND-AREA)
RIDFLD(ABND-VSAM-KEY)
RESP(WS-CICS-RESP)
RESP2(WS-CICS-RESP2)
END-EXEC.


Check Write Response

If the write operation is not successful (WS-CICS-RESP is not equal to DFHRESP(NORMAL)), an error message is displayed, and the program returns control to CICS.

           IF WS-CICS-RESP NOT= DFHRESP(NORMAL)
DISPLAY '*********************************************'
DISPLAY '**** Unable to write to the file ABNDFILE !!!'
DISPLAY 'RESP=' WS-CICS-RESP ' RESP2=' WS-CICS-RESP2
DISPLAY '*********************************************'

EXEC CICS RETURN
END-EXEC

END-IF.


Display 'ABEND record successfully written to ABNDFILE'

If the write operation is successful, a success message is displayed along with the contents of WS-ABND-AREA.

      D    DISPLAY 'ABEND record successfully written to ABNDFILE'.
D DISPLAY WS-ABND-AREA.


Perform GET-ME-OUT-OF-HERE

Finally, the program performs the GET-ME-OUT-OF-HERE section to return control to CICS.

           PERFORM GET-ME-OUT-OF-HERE.

 

This is an auto-generated document by Swimm 🌊 and has not yet been verified by a human