|
View previous topic :: View next topic
|
| Author |
Message |
chkiran2
New User

Joined: 24 Jun 2004 Posts: 24 Location: Gurgoan
|
|
|
|
WE can delete a data set using IEFBR14 using (old,delete). We can also delete the same using IDCAMS.
What is the difference and which is suitable in what conitions? Also can any one please give the code to delete data set using IDCAMS? |
|
| Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
using iefbr14 if your dataset does not exist the job will fail (JCL ERROR)
as dataset is 'linked' via DD statement, if you use DISP=(old,delete).
BUT if you use :
| Code: |
//DD0 DD DSN=your-dataset-name,DISP=(MOD,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(1,1,1),RLSE),LRECL=133,RECFM=FBA
|
(note disp is mod delete and lrecl and blksize can be anything u choose as dataset won't be used in that step.)
if dataset does not exist it is created and deleted in same JCL allocation CARD
if it exists it is EXPANDED (MOD) and deleted in same JCL allocation CARD
u can the allocate it as u wish.
and if somebody uses dataset your job is in contention for the dataset with that somebody (be it user or job)
___________________________________________________
using IDCAMS needs not be DD coded (it can be ) so job should end with a RC of 8 (trappable)
I think that is another user is using the dataset you are trying to delete it will end up with a rc.
I'd rather use IEFBR14 as aforementionned so my job hangs on to the dataset I'm using where as IDCAMS step may execute and subsequent execution would carry on. |
|
| Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
here are idcams examples :
| Code: |
//HH594DST JOB (CA1),'TMS UTILITY',MSGLEVEL=(1,1),REGION=0M
// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//*
//IDCAMS2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DFG DD DSNAME=DEVLI3.SDSF.JOBS,DISP=OLD
//SYSIN DD *
DELETE DFG
//*
|
maybe you should change allocation to (mod,delete) (see previous post)so that if dataset does not exist it is created (and deleted) but what if somebody browse the dataset ?
you would need to test the case.
another example without DD reference card :
| Code: |
//HH594DST JOB (CA1),'TMS UTILITY',MSGLEVEL=(1,1),REGION=0M,
// CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//*
//IDCAMS2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE DEVLI3.SDSF.JOBS
//*
|
hre dataset name is in sysin.
in that case dataset existence can be tested via RC (8 does not exist or somebody is using it)
I'm using IEFBR14 solution it works fine for me.
U need to find what suits u best.
hope I've beed helpful. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|