View previous topic :: View next topic |
Author |
Message |
warp5 Intermediate
Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Thu Apr 26, 2012 6:35 am Post subject: Find if data set exists but using volume |
|
|
Listdsi, Sysdsn both are great for inquiries wether a dat set exists, but this is only true for cataloged data sets. I need to check if a cataloged or a non cataloged (with volume) data set exists. My research leads me to believe that I will have to use either a TSO Alloc or a Ispexec LMINIT to find that out. Any suggestions or anybody know of a thread here?
I went with LMINIT unless somebody makes a better recommendation. |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Apr 26, 2012 7:07 am Post subject: |
|
|
For the uncataloged scenario ......................
What about using IEHLIST to list the volume. The code below is a basic IEHLIST, and you could probably build in an ISPF edit macro to do a find on the dataset name.
Code: | /* REXX *** IEHLIST */
"ISPEXEC CONTROL ERRORS RETURN"
X = MSG('OFF')
ARG VOLSER .
SYSUID = SYSVAR(SYSUID)
"FREE FI(SYSIN,SYSPRINT,DASDVOL)"
"DEL '"SYSUID".SYSPRINT.IEHLIST'"
"DEL '"SYSUID".SYSIN.IEHLIST'"
"ALLOC FI(SYSIN) NEW TRACKS SPACE(1 1) RECFM(F B) LRECL(80)"
"ALLOC FI(SYSPRINT) DA('"SYSUID".SYSPRINT.IEHLIST') NEW TRACKS
SPACE(15 15) RECFM(F B) LRECL(121)"
PUSH " LISTVTOC VOL=3390="VOLSER
"EXECIO 1 DISKW SYSIN ( FINIS"
X=BPXWDYN('ALLOC DD('DASDVOL') SHR REUSE UNIT(3390) VOL('VOLSER')')
"IEHLIST"
X=BPXWDYN('FREE DD('DASDVOL')')
"FREE FI(SYSIN,SYSPRINT)"
"ISPEXEC EDIT DATASET('"SYSUID".SYSPRINT.IEHLIST')" |
_________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
warp5 Intermediate
Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Thu Apr 26, 2012 7:34 am Post subject: |
|
|
Thanks expat, but I only need to find out about a specific dataset, and if it is not cataloged a volid has to be given on which I will search. I just about have it done already with lminit, but as usual, running into a few pit falls, you forget so much if you have not worked with it in a long time. |
|
Back to top |
|
|
|
|