Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
IDCAMS & IEFBR14

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
chkiran2

New User


Joined: 24 Jun 2004
Posts: 25
Location: Gurgoan

PostPosted: Tue Jun 29, 2004 11:04 am    Post subject: IDCAMS & IEFBR14
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
References
PostPosted: Tue Jun 29, 2004 11:04 am    Post subject: Re: IDCAMS & IEFBR14 Reply with quote

bluebird

Specialist


Joined: 03 Feb 2004
Posts: 144

PostPosted: Tue Jun 29, 2004 4:31 pm    Post subject:
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

Specialist


Joined: 03 Feb 2004
Posts: 144

PostPosted: Tue Jun 29, 2004 4:46 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1