IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Create a PDS and continue if it exists


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Fri Aug 29, 2008 10:42 pm
Reply with quote

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


Step :

Code:

000862 //CRPDSSRC   EXEC PGM=IEBCOPY
000863 //SYSPRINT DD SYSOUT=*
000864 //SYSIN    DD DUMMY
000865 //SYSUT1   DD DUMMY
000866 //SYSUT2   DD DSN=EXDU.&SYSUID..SOURCE,DISP=(NEW,CATLG),UNIT=DISK,
000867 //           DCB=(RECFM=FB,LRECL=80),DSNTYPE=(PDS),VOL=(,,,1),
000868 //           SPACE=(CYL,(1,1,1))
000878 //*-----------------------------------------------------------------
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Fri Aug 29, 2008 11:21 pm
Reply with quote

If I were you I would use IEFBR14 and DISP=(MOD,CATLG) This would create it if it does not exist and not end the job if it does exist.
Back to top
View user's profile Send private message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Fri Aug 29, 2008 11:56 pm
Reply with quote

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 ?

(*) e.g. : several members to create
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Aug 30, 2008 12:48 am
Reply with quote

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.
Back to top
View user's profile Send private message
Searchman

New User


Joined: 28 Dec 2006
Posts: 80
Location: France

PostPosted: Sat Aug 30, 2008 3:34 am
Reply with quote

Hello,

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...

Tell me if it's still not clear.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
No new posts COBOL - create and write to output fi... COBOL Programming 0
No new posts Best way to create an automated line ... TSO/ISPF 3
No new posts FD Section to Create FB or Vb File Dy... COBOL Programming 1
Search our Forums:

Back to Top