Fixes are available
COBOL for AIX Fix Pack 1 (February 2016 PTF) for 5.1
COBOL for AIX, V5.1.0.2 Fix Pack (December 2016 PTF)
COBOL for AIX, V5.1.0.3 Fix Pack (October 2017 PTF)
COBOL for AIX, V5.1.0.4 Fix Pack (January 2018 PTF)
COBOL for AIX, V5.1.0.5 Fix Pack (May 2018 PTF)
COBOL for AIX, V5.1.0.6 Fix Pack (October 2018 PTF)
COBOL for AIX, V5.1.0.7 Fix Pack (December 2018 PTF)
APAR status
Closed as program error.
Error description
When using the 'on size error' statement with values really large, the on size error does not seem to catch it, but instead traps at runtime. ===== COMPILE COMMAND: cob2 test.cbl ===== TESTCASE: $ cat test4.cbl IDENTIFICATION DIVISION. PROGRAM-ID. 'tst'. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 VAR1 PIC 9(18) value 100000000000000000. 01 VAR2 PIC 9(18) value 100000000000000000. 01 VAR3 PIC 9(18). PROCEDURE DIVISION. COMPUTE VAR3 = VAR1 * VAR2 * 10 on size error perform erro-overflow. DISPLAY "VAR3:", VAR3. STOP RUN. EXIT. erro-overflow. display "overflow". stop run. $ With test2.cbl (using smaller values), its fine: $ cat test2.cbl IDENTIFICATION DIVISION. PROGRAM-ID. 'tst'. ENVIRONMENT DIVISION. DATA DIVISION. WORKING-STORAGE SECTION. 01 VAR1 PIC 9(18) value 100000000000000. 01 VAR2 PIC 9(18) value 100000000000000. 01 VAR3 PIC 9(18). PROCEDURE DIVISION. COMPUTE VAR3 = VAR1 * VAR2 * 10 on size error perform erro-overflow. DISPLAY "VAR3:", VAR3. STOP RUN. EXIT. erro-overflow. display "overflow". stop run. $ ===== ACTUAL OUTPUT: $./a4.out <Thread 1> <Thread 1> Traceback: <Thread 1> Offset 0x00000564 in procedure writeERRmsg <Thread 1> Offset 0x00000044 in procedure _iwzWriteERRmsg <Thread 1> Offset 0x00000280 in procedure TST <Thread 1> --- End of call chain --- IWZ036W Truncation of high order digit positions occurred in program TST on line number 26. VAR3:000000000000000000 $ ===== EXPECTED OUTPUT: $./a2.out overflow $
Local fix
N/A
Problem summary
USERS AFFECTED: COBOL for AIX clients who use 'on size error' with very large values may be affected by this issue. PROBLEM DESCRIPTION: The program will produce an abend instead of catching the overflow in size error. The compiler was checking for overflow in the MOVE code. This code assumes that if it catches an overflow it should issue an error. But the MOVE code can be part of a statement with a SIZE ERROR phrase (as in this case).
Problem conclusion
The compiler code has been fixed to handle the above mentioned case.
Temporary fix
Comments
APAR Information
APAR number
PI55304
Reported component name
COBOL AIX RUNTI
Reported component ID
5724Z8702
Reported release
510
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2016-01-13
Closed date
2016-01-13
Last modified date
2016-01-13
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
COBOL AIX RUNTI
Fixed component ID
5724Z8702
Applicable component levels
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS6SGM","label":"COBOL for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"510","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]
Document Information
Modified date:
13 October 2021