View previous topic :: View next topic
|
Author |
Message |
Priya_1985
New User
Joined: 06 Oct 2008 Posts: 3 Location: Hyderabad
|
|
|
|
Hi! This is your First post in our Forums! So please be sure to 1) Use meaningful and descriptive Topic Title 2) Try to post your query in the relevant forum category 3) Make sure your query is not already posted and solved in our forums, Use the Search facility and avoid Reposts! If you are following the above rules, delete this message and post your query here! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
One DD for each, unless you want to use IDCAMS, or REXX, or possibly other utilities.
Please explain what you want to do, very clearly. |
|
Back to top |
|
|
Priya_1985
New User
Joined: 06 Oct 2008 Posts: 3 Location: Hyderabad
|
|
|
|
Hi
sry i will post clearly my question
i want to delete suppose 100 PDS i will be giving delete infront of them..is there any command at a time it can delete all the datasets. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
look at the access method services manual ( IDCAMS ) and read the delete section |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Any dsn pattern ? |
|
Back to top |
|
|
ashishsr123
New User
Joined: 06 May 2008 Posts: 33 Location: Chennai
|
|
|
|
We can use IEFBR14.
Then
Code: |
DD DSN=<DSN NAME>,
DISP=(OLD,DELETE,DELETE),
SPACE=(TRK,(1,1),RLSE)
|
Code this for all Datasets you have |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
ashishsr123
Unfortunately not the best method. This means that you will be coding 3 lines per dataset instead of one line per dataset. So immediately your workload has trebled.
Also, DISP=OLD - not the best choice - so what happens if some of the datasets are missing ? immediate JCL error.
DISP=(MOD,DELETE,DELETE) is far better because it will not fail if the dataset does not exist. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
And if the DSNs don't follow a patteren this type of work is really a pain ... |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
one problem with DISP=(MOD,DELETE,DELETE) is that if the dataset is migrated it will be recalled first before it is deleted.
IDCAMS is smart enough to know that if the dataset is migrated it will issue a HDELETE instead.
Gerry |
|
Back to top |
|
|
samuel_Inba
New User
Joined: 03 Jan 2008 Posts: 53 Location: Chennai
|
|
|
|
Hi Priya,
if the DSNs are of simillar pattern then u can delete them in a single idcams step. Let us know the datasets are of simillar patterns. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
samuel_Inba wrote: |
Hi Priya,
if the DSNs are of simillar pattern then u can delete them in a single idcams step. Let us know the datasets are of simillar patterns. |
IDCAMS generic only permits the use of one * wildcard which must replace a whole level, so may not delete all of the required datasets within a given pattern
and from the fine manual
Quote: |
Here is an example of how generic level DELETE works given the following data sets:
1) AAA.BBB.CCC.DDD
2) AAA.BBB.CCC.DDD
3) AAA.BBB.CCC.DDD.EEE
4) AAA.BBB.CCC
DELETE AAA.* results in the deletion of no data sets.
DELETE AAA.BBB.* results in the deletion of data set #4
DELETE AAA.BBB.*.DDD results in the selection of data sets #1 and #2
DELETE AAA.BBB.*.DDD.EEE results in the deletion of data set #3.
When a generic level name is specified, only one qualifier can replace the asterisk (*).
|
|
|
Back to top |
|
|
sachin_kaushik84
New User
Joined: 03 Oct 2008 Posts: 23 Location: noida
|
|
|
|
this is noit a good practice to delete the N number of dataset as if any one dataset is migrated or not present then it will create a problem for u...
so the best practice isto use IDCAMS with
//step1 exec pgm=idcams
// delete QQQ.* (QQQ is the start name of ur DSN )
i think this will work instead of using IEFBR14. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
sachin_kaushik84
Did you test your code before posting ?
Did you read the restrictions of IDCAMS generic before posting - see previous post above |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
And I'll ignore the two slashes (//) also before the "DELETE"..
..tough public..ya.. |
|
Back to top |
|
|
sachin_kaushik84
New User
Joined: 03 Oct 2008 Posts: 23 Location: noida
|
|
|
|
what do you try to figure out here i am not sure just the jcl means
//step1 exec pgm=idcams
//sysin dd *
delete (dataset name)
/*
//
i think this is ok |
|
Back to top |
|
|
|