Page 1 of 1

IEFBR14 error

PostPosted: Wed May 18, 2016 4:44 am
by primeducky
This was created for me and it works fine if the @ACS.PTRM.QUERY dataset already exists. However, if the dataset was previously deleted, the jcl abends as dataset not found. I've tried different parameters for DISP and can't figure out the correct code.

I've keep researching and researching this issue and cannot figure it out. Please help. Thank you

If the dataset exists, delete it and fill it with the data from the run.
If the dataset does not exist, create it and fill it with the data from the run.

000005 //DELFIL1 EXEC PGM=IEFBR14,COND=(0,NE)
000006 //DD01 DD DSN=@ACS.PTRM.QUERY,DISP=(OLD,DELETE,DELETE)

Re: IEFBR14 error

PostPosted: Wed May 18, 2016 6:12 am
by steve-myers
What I do is this -
//A       EXEC PGM=IEFBR14
//THEDS    DD  DISP=(MOD,DELETE),UNIT=SYSALLDA,SPACE=(TRK,0),
//             DSN=thedsn

I'm not going to explain in detail why this works. Examine the JCL Reference manual for your release if you're interested. Hint: Read the discussion of DISP=MOD very carefully.

IEFBR14 didn't "fail." In fact, it can't "fail," since all it does is set the return code to binary 0 and return. Your JCL failed. Fix the JCL and you're good to go.