Program A is calling Program B multiple times in the same logical unit of work,
In the first call to PGM B, We are opening a VSAM RRDS File (I-O Mode in PGM B & DISP=SHR in JCL of PGM A) and writing to the header record. We didn't closed the file in PGM B & control will be passed back to PGM A.
In the second call to PGM B, We have to write the Detail record in RRDS file. Here we are expecting the file to be open and hence we are directly writing into the file, which inturn gives file status code 48.
Please let us know how we can write into the RRDS file in the same logical unit of work without opening for each call.
Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
Does program B have INITIAL on the PROGRAM-ID? Using EXTERNAL may allow the file to stay open, but I've never done much with EXTERNAL files so I don't know that for sure.