View previous topic :: View next topic
|
Author |
Message |
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
I'm in the process of automating a daily proces that happens , I have around 4000 datasets to be deleted, but they are with different qualifiers.
I just want to know is there any way to write a COBOL program to delete the datasets.
Regards,
Mohan |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you could use dynamic allocation for a cobol program.
easier would be:
1. generate a list of datasets.
2. use this list as input to (anything - rexx, sort, cobol) to build DD statements for a step with IEFBR14, with disp=old,delete,delete.
keep in mind there are limits to the number of dd statements for a step and a job.
a cobol program with dynamic allocation might be quicker to write, but
a generated job that would have a dd statement for each ds would leave an easy audit trail to follow.
my personal opinion (no technical grounds) would be that the IEFBR14 job would run quicker. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I'm confused!
How would a COBOL program delete datasets, and more importantly, why would you write a program to do this? Usually you'd use Access Method Services (IDCAMS) to delete a given list of datasets. |
|
Back to top |
|
|
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
Hi all,
1) i have 4000 DSN s copied in a dataset.
2) I jus want to know is there any utility or program or code to delete the datasets(4000) that are located in a dataset.
could u assist me which process would b simple , JCL iefbr14 r IDCAMS or is there any COBOL prog.
Thanks,
Mohan |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What is the format of the dataset that contains the list of datasets. If you can format it properly then you can use IDCAMS to do the deletes. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Is this intended as a production job? Test? Where does the file get updated? Prod? Test?
Some solutions are OK in test; not OK in prod. Please provide ALL details for the best answer. |
|
Back to top |
|
|
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
It s all gonna be a test datasets , that we have used during our testing process.It s of no use absolutely in future. So we want to delete it , since the count is very high around 4000 datasets , i need a jcl code or cobol code to delete the all 4000 datasets at a single stretch , will it be possible.
Kindly help me in this regard.
thanks in advance,
regards,
Mohan |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I would go for REXX.
O. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
if all the datasets with the same high level qualifier can be deletete
idcams delete hlq1.hlq2.hlq3.*
wiil do the job
the star is a generic placeholder for just one qualifier
another solution could be to run a dfdss job wit a dummy output
(the filtering capabilities of dfdss are quite sophisticated)
check the manual |
|
Back to top |
|
|
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
In my requirement I have hlq1.hlq2.****.*** here hlq1 and hlq2 alone is common in all my datasets, the 3rd and 4th qualifier differs in all datasets.
Can you please gimme the sample JCL to get through this process.
Thanks ,
Mohan |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
Thanks enrico!!
Lemme try this , alsoI want to know is there any other simple way of doing it .
Regards,
Mohan |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
No ( or at least I have no reason/time to investigate other solutions )
isn' t the dfdss job simple enough
the filtering capabilities of idcams delete are not sophisticated as dfdss' s
(with dfdss You can filter aon substrings of a qualifier )
furthermore with dfdss has a very powerful approach to check for results
Quote: |
TYPRUN=NORUN
For copy, dump, restore, compress, and release operations, only input data set selection is done without actually processing data sets. Printed output for the run indicates the data sets selected. For a defragmentation operation, the initial volume statistics are printed without actually relocating any extents. For a CONVERTV operation, a full report is produced, but no volumes or data sets are actually converted. For CGCREATE operation, only control card syntax checking is done. The task is not processed. |
|
|
Back to top |
|
|
MoganaKumaran
New User
Joined: 26 Jun 2007 Posts: 20 Location: Chennai
|
|
|
|
Thanks enrico.
I can go with this ...
Thannk u very much... |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Probably too late, but here's another:
3.4 hlq1.hlq2.*
in cmd line: SAVE list4k
This creates yrTSOid.list4y.datasets
Using EDIT delete everything except the DSN; insert " DELETE " at pos 1 of each line. e.g.:
C ALL 46 140 P'¬' '';res chg;C ALL 1 P'=' 'bDELETEb' (note: b = space)
save the results
Use following JCL:
Code: |
//*
//STEP010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD disp=shr,dsn=yrTSOid.list4k.datasets
|
|
|
Back to top |
|
|
|