IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

IDCAMS vs IEFBR14


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chkiran2

New User


Joined: 24 Jun 2004
Posts: 24
Location: Gurgoan

PostPosted: Tue Jun 29, 2004 11:04 am
Reply with quote

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
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Tue Jun 29, 2004 4:31 pm
Reply with quote

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
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Tue Jun 29, 2004 4:46 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts IDCAMS listcat service using cobol JCL & VSAM 1
No new posts TWS - ETT File triggering does not wo... IBM Tools 4
No new posts IDCAMS & LISTCAT with ddnames JCL & VSAM 1
No new posts Capture DSN names through SORT / IDCAMS DFSORT/ICETOOL 8
No new posts IDCAMS RENAMING VSAM FILE ALONG WITH ... JCL & VSAM 12
Search our Forums:

Back to Top