Previous Topic: Detect and Prevent an AbendNext Topic: Dynamically Change the Value in TASKNUM


Determine the Cause of the Error

Next confirm that the value stored in TASKNUM is not in valid arithmetic format by examining its current value; that is, its value prior to the execution of the ADD statement that triggered the ASRA.

CA InterTest for CICS displays the current value of TASKNUM, as shown in the following screen:

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

When the AutoKeep Display feature is active, CA InterTest automatically displays the value(s) of the variable(s) associated with a line of code. In this case, TASKNUM has been displayed in this specially formatted Keep window. On the left is the name of the data item; on the right is the fields' datatype appropriate display format. The question mark in the beginning of the field indicates that it contains incorrect values for its datatype.

Up to six data items will be displayed at a time within the scrollable Keep window. This feature lets you see how the values of data items change as your program executes. The Keep window remains until you remove all data items from it.

Note: A full discussion of the Keep window is described in Keeping Data Items in the Keep window in the chapter "Debugging Programs". Now take a look at the contents of TASKNUM. It does not contain a valid packed decimal value. Instead, it contains low‑values (binary zeros). COBOL does not allow you to add a value to a field without initializing it.