At 01:53 PM 01/06/2006, you wrote:
I'm passing on this question (with permission from Doc Dwarf) that I
expect a Rexx expert will come up with the best solution
[EMAIL PROTECTED] wrote in comp.lang.cobol:
[OT] IBM Mainframe DSLIST to Dataset w/ Wildcards?
All righty... here's how we're spending some slow time here. Datasets
get
generated on a biweekly basis with the format:
USERID01.TAnnnnn.Pooo.Ddddhhmm.node
... where nnnnn represents a division, ooo is a pay period, ddd =
'Julian'
date, hhmm = time and .node is any one of four possible values. The
primary criterion of selection will be ooo, the pay period.
(Pay period is designated as single-digit year and 01 - 27, a biweekly
cycle; research has determined that the earliest datasets are P0, year
2000, and that no P9 exist.)
(I know... but I didn't design the naming convention.)
Folks in corner offices want these deleted and their wills be done...
but
I'm looking to automate the task since there are about 14,000 datasets
involved, spread out over five USERIDs... oh, and most - but not all -
are
in MIGRAT1 or MIGRAT2 status.
Now... if I use the (Library Function) 3.4 Data Set List Utility I can
specify a wildcarded string - eg USERID02.TA*.P0* - and the P
command-line
option; if I log off and Keep my listing dataset I can then use it as
input to a DFSORT, taking the listings of
USERID02.TA11111.P001.NODE1
USERID02.TA11111.P001.NODE2
USERID02.TA22222.P001.NODE1
USERID02.TA22222.P002.NODE2
... etc. and editing/reformatting them to create another file,
consisting
of...
HDELETE USERID02.TA11111.P001.NODE1
HDELETE USERID02.TA11111.P001.NODE2
HDELETE USERID02.TA22222.P001.NODE1
HDELETE USERID02.TA22222.P002.NODE2
... and use that as a SYSTSIN for an IKJEFT01. For the datasets that
aren't archived I can do this again and create an IDCAMS input of
DELETE USERID02.TA33333.P026.NODE3
... and get rid of the last.
Combining an interactive task, a logoff/logon sequence and a batch job
in
this way - while it will work - offends my sense of elegance; while I
have
a solution I'm looking for a better one.
What I'd like to do is find a utility that does in batch what the Data
Set
List Utility does in the foreground, something that I can feed a string
like USERID02.TA*.P0* and have it generate the listing of the datasets
that I can feed to a SYSOUT and pass to the DFSORT edit/reformat step.
Might anyone be able to suggest where I might look to find such a
utility?
Thanks much!
DD
One possible solution is to use the ADRDSSU utility. Our operations
center uses this every night to delete test files left out on DASD
volumes by the programmers. Basically, the have a parmlib member
wherein programmers can EXCLUDE particular members from that night's
deletes. Everything else is deleted. As an example the parmlib
member might look like this:
DUMP DATASET INCLUDE (H0SD1.**) -
EXCLUDE (H0SD1.MYFILE.**.**)) -
OUTDD (TAPEOUT) -
TOL (IOER) -
ALLX -
OPT(3) -
DELETE PURGE
In the previous, the utility would delete everything (sam, vsam etc.)
that started with a high order qualifier of H0SD1 except if the
second qualifier was MYFILE. In JCL TAPEOUT would be assigned to
dummy. You could of course assign it to a real cartridge and backup
everything but we don't do that for test files.
For your purposes, you may want to try a dump command that has an
include of (USERID02.TA*.P0*.**) or to catch all user ids something
like (USERID*.TA*.P0*.**) might work.
With this solution, you don't need REXX. It is just a straight
forward JCL utility job.
Steve Wiegand
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html