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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm

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