Previous Topic: Start Program ExecutionNext Topic: Determine the Cause of the Error


Detect and Prevent an Abend

The next screen you see is not displayed by the COBOL demo. It is a diagnostic screen, called a breakpoint display, which is displayed by CA InterTest when it detects an error.

CA InterTest for CICS V9.1 - PROTSYM FILE ABEND DETECTED BREAKPOINT COMMAND ===> Program= COBDEMO Option # Stmt # Margin= 01 Search= ------------------------------------------------------------------------------- _____ TASKNUM | ?00000. ---------+--------------------------------------------------------------------- _ 000477 CONTINUE-TASK. 000478**** TASKNUM *NOTE* FIELD MUST BE INITIALIZED A ==> ADD +1 TO TASKNUM. ==> ==> ASRA ABEND (0C7) detected and prevented. Caused by invalid decimal ==> arithmetic data format. ==> ==> Press PF1 for a detailed description. ==> _ 000480 IF TASKNUM = 1 _ 000481 MOVE 'DMAPASR' TO MAPNAME. _ 000482 IF TASKNUM = 2 _ 000483 MOVE 'DMAPSUM' TO MAPNAME. _ 000484 IF TASKNUM GREATER 2 _ 000485 GO TO SEND-END-MSG. _ 000486 GO TO REWRITE-TSQ. _ 000487 REWRITE-TSQ. 000488*EXEC CICS WRITEQ TS

Notice that CA InterTest has highlighted an ADD instruction and displayed a message below it.

Execution of that ADD instruction triggered an ASRA abend. CA InterTest prevented the abend and then displayed the diagnostic screen you are currently viewing.

When CA InterTest stops program execution, we say that it halts the program at a breakpoint. This can be done automatically, or CA InterTest halts a program at a breakpoint that was set by you, the programmer. The A to the left of the ADD statement indicates that the current halt in program execution is an Automatic breakpoint—not one set by you

Now look at the highlighted message. It explains that the problem was caused by improperly formatted data. Which data? Since ADD +1 TO TASKNUM triggered the breakpoint, it is likely that TASKNUM contains improperly formatted data.

So far, CA InterTest has prevented COBDEMO from abending and identified the problem.

Next, perform the following steps:

  1. Determine the cause of the error.
  2. Dynamically correct the error by changing the value of TASKNUM.