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

IEFBR14 to delete tape without tape mount


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

New User


Joined: 15 Jan 2015
Posts: 35
Location: USA

PostPosted: Thu Jan 29, 2015 8:51 am
Reply with quote

I usually use IDCAMS to delete a tape, but in this JCL, I wish to use the SET to set up a variable for the tape dataset name. I am using that name in several job steps, so it makes it easier, plus I might change the name - and it minimizes what I need to change.

But I can't use a set variable in IDCAMS (for sysin)

So, I thought I would use IEFBR14 which works, unless the file is a tape. Is there any way to avoid the tape mount when I use IEFBR14?

Or maybe another quick way to delete a tape file where I could use a set variable?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 869
Location: The Universe

PostPosted: Thu Jan 29, 2015 9:46 am
Reply with quote

Option 1 -
Code:
// SET NAME='?'
//DELETE  EXEC PGM=IEFBR14
//KILLDS   DD  DISP=(OLD,DELETE),UNIT=(,DEFER),
//             DSN=&NAME

Option 2 -
Code:
// SET NAME='?'
//DELETE  EXEC PGM=IKJEFT01,PARM='DELETE ''&NAME'' NOSCRATCH'
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
The UNIT=(,DEFER) in option 1 will prevent the mount, though a tape drive will be allocated for a few seconds.

In option 2, it is not widely appreciated that the TSO DELETE command is really just a front end for the IDCAMS DELETE command
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Thu Jan 29, 2015 6:51 pm
Reply with quote

Lynne Schuler wrote:

But I can't use a set variable in IDCAMS (for sysin)


Why not?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Jan 29, 2015 7:54 pm
Reply with quote

Not up-to-date with release of z/OS?
Back to top
View user's profile Send private message
Lynne Schuler

New User


Joined: 15 Jan 2015
Posts: 35
Location: USA

PostPosted: Sat Jan 31, 2015 6:06 am
Reply with quote

Thank you, Steve Meyers for your post.

However, I did do some more research after posting this question, and I found out z/OS v2r1 has added the JCL EXPORT statement which allows JCL and system variables to be included/interpreted in SYSIN data. So, that is what I did, and it works great.

For anyone else with this question, here is a link to the article that I found on this:
article

and a link to the documentation
documentation
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 Record count of RECFM=U tape file DFSORT/ICETOOL 17
No new posts TWS - ETT File triggering does not wo... IBM Tools 4
No new posts Need to delete inactive records from ... DB2 5
No new posts Using Virtual Tape Server TS7700 as c... All Other Mainframe Topics 0
No new posts Unable to delete dataset - VSAM datas... JCL & VSAM 20
Search our Forums:

Back to Top