I have to use a PDS, but I don't know if it exists, so I create it.
If it exists or not (it will be created in this case) , I continue to the next step
The problem is that the job stops at this step if the PDS is already cataloged
Either with IEFBR14 or with IEBCOPY, the result is the same, the execution is stopped and next steps are bypassed !
How can I do to continue in spite of the failed allocation ?
Code:
ICH70001I U97657 LAST ACCESS AT 18:32:48 ON FRIDAY,
IEF344I D97657BQ CRPDSSRC SYSUT2 - ALLOCATION FAILED
IGD17101I DATA SET EXDU.U97657.SOURCE
NOT DEFINED BECAUSE DUPLICATE NAME EXISTS IN CATALOG
RETURN CODE IS 8 REASON CODE IS 38 IGG0CLEH
IEF272I D97657BQ CRPDSSRC - STEP WAS NOT EXECUTED.
IEF285I U97657.D97657BQ.JOB12266.D0000107.?
*** FIN STEP 1 ------------------------------------
IEF373I STEP/CRPDSSRC/START 2008242.1847
IEF374I STEP/CRPDSSRC/STOP 2008242.1847 CPU 0MIN
Thank you very much, it works very well now !
(I didn't know it was possible to catalog with MOD)
Excuse me, there's something I didn't say in my previous post.
It's not important in my case, but it could be (?)(*). In fact, IEFBR14 allways returns 0 and if I have to excute a step only if the PDS has really been created in the preceeding step IEFBR14, I can't use a COND= in the step ?
So, how could I do it ?
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
It may help clarify if you explain why the pds may or may not exist.
I would suggest making sure that these datasets be pre-allocated and the process not be concerned. This appears to add unneeded complexity to what might not need to be complex.
If you explain the real requirement rather than these mechanics, we may be able to offer more usable suggestions.
Dick, I ask this question because I'd like to simplify the problem !
The goal is, in one JCL, to compile and run PGM COBOL written directly in the JCL
Compile and Link-edit are in a PROC called in the JCL
The JCL needs 3 PDS :
1- source for COPY COBOL (used in SYSLIB of PROC)
2- for load built by PROC
3- containing PROC (declared in JCLLIB)
At the beginning, I had created 2 JCL, one to create the 3 PDS and the PROC, and the second to compile and link
But, to simplify and not to have to run 2 JCL, I thought to put all steps in the same JCL. Moreover, the PDS can be deleted at any moment by the system. So, not to ask the question "Do the PDS exist ?", I wanted only one JCL to 1-create (or not il they exist) the PDS ; 2-and then compile and run the program. The PDS exist ? It's good ! No ? It doesn't matter, The JCL create them.
Notice that for 1 and 2, it's possible to create them (unless 2 is declared in STEPLIB and not in JOBLIB) in one JCL
For the PDS containing PROC called by JCL, I find a difficulty, because it must be declared in the JCCLIB, that causes a conflict...