Getting details of activity ABENDs

If a CHECK ACTIVITY command returns a completion status (COMPSTATUS) of ABEND, you can use the INQUIRE ACTIVITYID command to obtain further information about how the activity abended. For example:

    If status = DFHVALUE(ABEND)
        .
        To get the activity-identifier of the failed child,
        start a browse of child activities
        EXEC CICS STARTBROWSE ACTIVITY
                       BROWSETOKEN(root-token)
               RESP(data-area) RESP2(data-area) END-EXEC
         .
         EXEC CICS GETNEXT ACTIVITY(child-name)
                        BROWSETOKEN(root-token)
                        ACTIVITYID(child-id)
               RESP(data-area) RESP2(data-area) END-EXEC
         .
         loop until the failed child is found by name
            EXEC CICS GETNEXT ACTIVITY(child-name)
                           BROWSETOKEN(root-token)
                           ACTIVITYID(child-id)
                  RESP(data-area) RESP2(data-area) END-EXEC
            .         
         end child activity browse loop
         Inquire on the failed child, using its activity-identifier
         EXEC CICS INQUIRE ACTIVITYID(child-id)
                       ABCODE(data-area)
                       ABPROGRAM(data-area)
               RESP(data-area) RESP2(data-area) END-EXEC

This example returns the name of the program in which the abend occurred, together with the corresponding CICS® abend code.

Note:
A simpler way of obtaining the activity-identifier of the failed child activity (used on the EXEC CICS INQUIRE ACTIVITYID command) would be to code the ACTIVITYID option of the DEFINE ACTIVITY command used to define the child, and to store the returned value.

Related concepts
Using the BTS API to write business applications
The Sale example application
Related tasks
Checking the response from a synchronous activity
Checking the response from an asynchronous activity
Retrying failed activities
Related reference
Overview of BTS API commands
BTS application programming commands
[[ Contents Previous Page | Next Page Index ]]