On Fri, 23 May 2014 16:02:08 +0000, Grinsell, Don wrote: >I have an end user job that is getting a JCL error and I know >how to fix it but I can't explain exactly why it's failing. I can >recreate the error with the following JCL: > >//STEP1 EXEC PGM=IEFBR14 >//DD1 DD DSN=F00.DUMMY,DISP=(NEW,PASS,DELETE), >// UNIT=TEMPSTOR,SPACE=(TRK,1),RECFM=FB,LRECL=80 >//STEP2 EXEC PGM=IEFBR14 >//DD1 DD * >RECORD1 >// DD DSN=F00.DUMMY,DISP=OLD >//STEP3 EXEC PGM=IEFBR14 >//DD1 DD DSN=F00.DUMMY,DISP=(OLD,DELETE,KEEP) > >F00.DUMMY gets allocated in STEP1 and is deleted at the end of STEP2
The data set is not deleted. It is removed from the passed data queue. (Is that still what it is called?) >causing STEP3 to get a JCL error. I can correct the situation by >specifying DISP=(OLD,PASS) in STEP2 or simply removing STEP3. >My question is why does the dataset get deleted in STEP2? When a PASSed data set is referenced in a subsequent step, it is removed from the passed data queue. If you had another DD in STEP2 that referenced the same data set, that allocation would fail also. Another way to fix the problem would be to add VOL=REF=*.STEP1.DD1 to the DD in STEP3, proving that the data set was not deleted at the end of STEP2. In fact, you could also resolve the problem by putting the VOL=REF=*.STEP1.DD1 on the DD in STEP2. In that case, the passed data queue is not used, leaving the entry there to be used in step 3. The reference to the default of DELETE for a new data set does not apply here. That default is for the step, not the job. The default for the data set in STEP2 is KEEP, because it was OLD in STEP2. -- Tom Marchant ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
