Well, I had this issue yesterday and my programmer could not understand why this solution was necessary, but it worked. I'd really like to be able to understand it, as well as get him an explanation. A job is kicked off in the QUSRWRK subsystem for the sole purpose of running: STRS36PRC PRC(ACSUP1). The OCL for ACSUP1 is:
ACSUP1 reads through the ACSDATA file and applies the necessary changes to the appropriate accounts. ACSUP3 and 4 are both reports that also have the identical line referring to ACSDATA. What I found was that the job would run the first program and then hang waiting for exclusive access to ACSDATA. [No other programs access this file in the entire system] The solution was to add ',DISP-SHR' to each procedure for ACSDATA. Since the one procedure calls Program 1, then OCL 2 for Program 2, then OCL 3 for Program 3, but all are under the same user... Why would it wait for itself to give itself access to a file it just used? My programmer had said something like when the last record is read on a file, the locks are released. But if that's the case, then it really doesn't make sense here. Any guidance would be hugely appreciated!! Thank you!
Code:
// LOAD ACSUP1 // FILE NAME-ACSDATA // FILE NAME-ACCTMAST,DISP-SHR // RUN * ACSUP3 ACSUP4
Comment