Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to delete 'N' no of datasets at a time in jcl?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Priya_1985

New User


Joined: 06 Oct 2008
Posts: 3
Location: Hyderabad

PostPosted: Fri Oct 17, 2008 3:16 pm    Post subject: How to delete 'N' no of datasets at a time in jcl?
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 17, 2008 3:22 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Priya_1985

New User


Joined: 06 Oct 2008
Posts: 3
Location: Hyderabad

PostPosted: Fri Oct 17, 2008 3:31 pm    Post subject: Reply to: How to delete 'N' no of datasets at a time in jcl?
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Oct 17, 2008 3:33 pm    Post subject: Reply to: How to delete 'N' no of datasets at a time in jcl?
Reply with quote

look at the access method services manual ( IDCAMS ) and read the delete section
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 17, 2008 3:41 pm    Post subject:
Reply with quote

Any dsn pattern ?
Back to top
View user's profile Send private message
ashishsr123

New User


Joined: 06 May 2008
Posts: 33
Location: Chennai

PostPosted: Fri Oct 17, 2008 3:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Oct 17, 2008 3:49 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sat Oct 18, 2008 2:05 am    Post subject:
Reply with quote

And if the DSNs don't follow a patteren this type of work is really a pain ...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat Oct 18, 2008 4:33 am    Post subject:
Reply with quote

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
View user's profile Send private message
samuel_Inba

New User


Joined: 03 Jan 2008
Posts: 53
Location: Chennai

PostPosted: Tue Oct 21, 2008 12:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Oct 21, 2008 1:06 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sachin_kaushik84

New User


Joined: 03 Oct 2008
Posts: 23
Location: noida

PostPosted: Tue Oct 21, 2008 2:41 pm    Post subject: want to delete suppose 100 PDS i will be giving delete
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Oct 21, 2008 2:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Oct 21, 2008 3:00 pm    Post subject:
Reply with quote

And I'll ignore the two slashes (//) also before the "DELETE".. icon_wink.gif

..tough public..ya.. icon_smile.gif
Back to top
View user's profile Send private message
sachin_kaushik84

New User


Joined: 03 Oct 2008
Posts: 23
Location: noida

PostPosted: Tue Oct 21, 2008 3:51 pm    Post subject: Did you test your code before posting
Reply with quote

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 icon_razz.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us