Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Create a PDS and continue if it exists

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Create a PDS and continue if it exists
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    Post subject:
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    Post subject: Reply to: Create a PDS and continue if it exists
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

Site Director


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

PostPosted: Sat Aug 30, 2008 12:48 am    Post subject:
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    Post subject: Reply to: Create a PDS and continue if it exists
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
This topic is locked: you cannot edit posts or make replies. Job to wait and continue based on reply yugendran COBOL Programming 5 Wed Oct 05, 2016 1:46 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Not enough virtual memory is availabl... Vinay Pushpala IBM Tools 16 Tue Sep 13, 2016 4:37 pm
No new posts Need to create file with Dynamic Name... kapil27 JCL & VSAM 4 Wed May 25, 2016 9:45 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us