IBM Support

ASRA 0C7 on Add Packed (AP) instruction within COBOL program

Question & Answer


Question

Why is my COBOL program getting a program check with an abend0C7 abendASRA when executing an AP (Add Packed) instruction? I took a SR0001 dump. The abending instruction in the dump is an "ADD PACKED" which is equivalent to a "ADD A TO B" instruction in COBOL. A is defined as PIC 99 and B is defined as PIC +9(5) COMP-3. The content of A is X'0000' and B is X'00824C'. Since the content of the the COMP-3 field is a valid packed decimal value, I don't understand the reason for the data exception.

Answer

The values you quote from the dump are correct. The problem is that both operands must be packed fields. As you are aware, the first operand is two bytes of zeros. Here is the quote from the Principle of Operations (POPs) manual:

The second operand is added to the first operand, and the resulting sum is placed at the first-operand location. The operands and result are in the packed format.

So to fix the abend ASRA 0C7, you should make operand 1 a packed field. Alternatively, you can check your NUMPROC COBOL compiler option. If it is not defaulting to NUMPROC (NOPFD), which you can use if your numeric internal decimal and zoned decimal data might use nonpreferred signs, then consider changing NUMPROC to NOPFD and retest. If testing proves to resolve the data exception then review the NUMPROC option to ensure the behavior is what you expect.

NUMPROC Cobol compiler option

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGMGV","label":"CICS Transaction Server"},"Platform":[{"code":"PF035","label":"z\/OS"}],"Component":"COBOL","Version":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSAU5Z","label":"COBOL Compilers"},"Platform":[{"code":"PF035","label":"z\/OS"}],"Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Product Synonym

CICS/TS CICSTS CICS TS CICS Transaction Server

Document Information

Modified date:
20 July 2021

UID

dwa1213772