Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Compiler and Runtime Migration Guide


Example 2: Effect on compatibility

 IDENTIFICATION DIVISION.
 PROGRAM-ID. PGM1
 ENVIRONMENT DIVISION.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 01  DATA1    PIC 9 VALUE 0.
 01  DATA2    PIC 9 VALUE 1.
 PROCEDURE DIVISION.
     EXEC CICS HANDLE ABEND LABEL(LBL1) END-EXEC.
     CALL "PGM2" USING DFHEIBLK DFHCOMMAREA
* Force a DIVIDE-BY-ZERO exception
     COMPUTE DATA1 = DATA2 / DATA1
     EXEC CICS RETURN END-EXEC.
 LBL1.
     EXEC CICS RETURN END-EXEC.

 IDENTIFICATION DIVISION.
 PROGRAM-ID. PGM2
 ENVIRONMENT DIVISION.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
 PROCEDURE DIVISION.
     EXEC CICS HANDLE ABEND LABEL(LBL1A) END-EXEC.
     GOBACK.
 LBL1A.
     GOBACK.

In this example the CBLPSHPOP option will affect compatibility with VS COBOL II. With CBLPSHPOP(ON), PGM1's HANDLE ABEND label is saved and restored across the call to PGM2, and the divide by zero exception is handled with a branch to LBL1. The program terminates normally.

With CBLPSHPOP(OFF), PGM2's HANDLE ABEND command is in effect on the return to PGM1. The exception caused by the divide by zero in PGM1 causes CICS to ask Language Environment to branch to LBL1A in PGM2. Language Environment prevents this branch, and the program terminates with an ASRA abend.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)