View previous topic :: View next topic
|
Author |
Message |
Lynne
New User
Joined: 15 Jan 2015 Posts: 93 Location: USA
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Lynne Schuler wrote: |
But I can't use a set variable in IDCAMS (for sysin) |
Why not? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Not up-to-date with release of z/OS? |
|
Back to top |
|
|
Lynne
New User
Joined: 15 Jan 2015 Posts: 93 Location: USA
|
|
|
|
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 |
|
|
|