Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
defining a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rashmi.ranjan75

New User


Joined: 20 Feb 2006
Posts: 34

PostPosted: Wed Mar 29, 2006 8:18 pm    Post subject: defining a dataset
Reply with quote

Hello,

How can i perform following step in a jcl for sequential dataset

Overwrite if exist and else create

Please suggest

regards
rashmi
Back to top
View user's profile Send private message

Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Wed Mar 29, 2006 9:21 pm    Post subject: Re: defining a dataset
Reply with quote

include thE STEP 1 in your jcl before the step to delete the dataset(if it already exists)

//step1 EXEC UNCAT
//U.SYSIN DD *
DELETE DSN=dataset name
/*

this creates the dataset...Change values for parameters as required.
//step2 EXEC PGM= IEFBR14
//data1 DD DSN=datasetname
// DISP=(NEW,CATLG,DELETE,UNIT=SYSDA,
// RECFM=FB,LRECL=64,MGMTCLAS=MCEXP3MO,
// SPACE=(64,(1,1),RLSE)
Back to top
View user's profile Send private message
Lkmi

New User


Joined: 04 Mar 2005
Posts: 53
Location: Newyork

PostPosted: Wed Mar 29, 2006 9:27 pm    Post subject: Re: defining a dataset
Reply with quote

BY THE WAY THE SOLUTION I GAVE WUD CREATE IF IT ALREADY EXISTS.
iam not sure if it can be overwritten
Back to top
View user's profile Send private message
rajakumar10

New User


Joined: 03 Aug 2005
Posts: 12

PostPosted: Wed Mar 29, 2006 10:03 pm    Post subject:
Reply with quote

use IDCAMS with the control card "LISTCAT ENT(datasetname)". This will lead to a RC of 4 if the dataset does not exist, and to a RC of 0 if it does exist.

If RC eq 0
overwrite
if RC eq 4
create

Hope this helps.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Thu Mar 30, 2006 5:00 pm    Post subject: Re: defining a dataset
Reply with quote

Hi,

Adding to LKMI's solution just add following line after step1

If MAXCC=8 maxcc=0
If file does not exist it will create file in step2.

Regards
Rupesh
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
No new posts Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am
No new posts Temp dataset unusual behavior sheersh JCL & VSAM 5 Tue May 08, 2018 9:52 pm
No new posts Defining SYSLIB to USS c++ (cxx) comp... Harold Barnes All Other Mainframe Topics 2 Sat Apr 07, 2018 5:06 am
No new posts Defining SSL Port in TCPIP for DB2 Se... Yolanda Harvey TSO/ISPF 1 Wed Mar 28, 2018 7:33 pm
No new posts How could i share my personal dataset... James Halley TSO/ISPF 1 Fri Mar 23, 2018 9:41 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us