Author Topic: COBOL V5 exposes poor coding practice in exit ARSEXINP  (Read 1887 times)

Ed_Arnold

  • Hero Member
  • *****
  • Posts: 1204
    • View Profile
COBOL V5 exposes poor coding practice in exit ARSEXINP
« on: March 24, 2016, 12:09:20 PM »
Two files get opened in sample exit ARSEXINP.

One, STATS-FILE, does not get properly closed before program termination.

In COBOL V4 and below this condition was tolerated and nobody ever knew there was a problem.

With COBOL V5 we get into a race condition in multi-threaded COBOL and the program ends up looping during termination.

What's interesting is that the LOAD itself completes successfully, it's not until the very very end when files are being closed that the loop occurs.

APAR PI59610 has been opened to update the sample ARSEXINP in SARSINST

ERROR DESCRIPTION:                                               
When compiled under COBOL V5 and above sample ARSEXINP does not 
properly close all files resulting in a loop.               
                                                                 
LOCAL FIX:                                                       
Compile with COBOL V4 and below or ensure that all files are     
closed before program termination.
                               
                                                                 
Ed
#zOS #ODF