View previous topic :: View next topic
|
Author |
Message |
rashmi.ranjan75
New User
Joined: 20 Feb 2006 Posts: 34
|
|
|
|
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 |
|
|
Lkmi
New User
Joined: 04 Mar 2005 Posts: 53 Location: Newyork
|
|
|
|
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 |
|
|
Lkmi
New User
Joined: 04 Mar 2005 Posts: 53 Location: Newyork
|
|
|
|
BY THE WAY THE SOLUTION I GAVE WUD CREATE IF IT ALREADY EXISTS.
iam not sure if it can be overwritten |
|
Back to top |
|
|
rajakumar10
New User
Joined: 03 Aug 2005 Posts: 12
|
|
|
|
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 |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
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 |
|
|
|