DELETE members



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

DELETE members

Postby manesg » Wed Sep 16, 2009 11:53 am

Hi Folks,

Iam deleting members from the dataset.
I could delete using the following jcl

/RENDEL JOB (PS),'PS-RENAMEDEL',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE MBOLT.MTEMPX.M7AWXX.DATA04(ERRESHP)
DELETE MBOLT.MTEMPX.M7AWXX.DATA04(ERRITRC)
DELETE MBOLT.MTEMPX.M7AWXX.DATA04(ERRIDX)
DELETE MBOLT.MTEMPX.M7AWXX.DATA04(ELSPUV)
//*

But here, i need to specify each member to be deleted. (which works fine). There are more than 50members. So do i need to specify 50 times of those members to be deleted? Is there any other option.
I tried the following

DELETE MBOLT.MTEMPX.M7AWXX.DATA04(*)

but it does not empty the contents of the dataset. It results in error.

Thanks
manesg
 
Posts: 22
Joined: Thu Jul 17, 2008 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: DELETE members

 

Re: DELETE members

Postby expat » Wed Sep 16, 2009 2:42 pm

If you want to delete all members, why not just delete / define the whole PDS
expat
 
Posts: 382
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 1 time

Re: DELETE members

Postby manesg » Sun Sep 20, 2009 6:18 pm

Thanks expat.
Actually that was a typo in the first line. It should read as //
Can you let me know the syntax?
You mean i specify the following to delete?
//RENDEL JOB (PS),'PS-RENAMEDEL',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE MBOLT.MTEMPX.M7AWXX.DATA04

Is this what you meant? (I only want to delete the contents of MBOLT.MTEMPX.M7AWXX.DATA04 and not the dataset itself)
manesg
 
Posts: 22
Joined: Thu Jul 17, 2008 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: DELETE members

Postby dick scherrer » Mon Sep 21, 2009 2:43 am

Hello,

If you want to save keystrokes (eliminating a statement for each member) deleting the dataset and allocating a new one of the same name would be rather painless.

Is there some reason that the dataset should not be deleted and re-allocated?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: DELETE members

Postby manesg » Mon Sep 21, 2009 6:18 pm

Hi Dick,

Thanks for pointing.
Scenario-1: (As specified in my post earlier)
In the above example i would delete all the contents of the dataset.
Scenario-2:
But in another dataset i do not want to delete the dataset itself because,
The reason: This is another dataset wherein i will do the following (Total 25 members in the dataset)

1 member to renamed (POLT to POLTOLD)
2 members not to be deleted
22 members to be deleted.

So what i do is,
step1: Rename the member (POLT to POLTOLD)
step2: delete rest of the 22 members. (will be writing a statement for each member to be deleted)

So this is the reason, i thought i would not want to delete the dataset, rather only delete some of its contents.

In Scenario-1 i would delete all the contents of the dataset.
Yes, dick i will use what you have suggested for Scenario-1 and let you know if any issues come up. Thanks again.
manesg
 
Posts: 22
Joined: Thu Jul 17, 2008 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: DELETE members

Postby dick scherrer » Tue Sep 22, 2009 12:03 am

You're welcome - good luck :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: DELETE members

Postby manesg » Wed Dec 02, 2009 12:17 pm

Thanks Dick.
It worked. No issues.
Thanks again for pointing me to right direction.
manesg
 
Posts: 22
Joined: Thu Jul 17, 2008 11:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: DELETE members

Postby dick scherrer » Thu Dec 03, 2009 4:02 am

Good to hear it worked - thanks for letting us know :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: DELETE members

Postby cvrupesh » Wed Oct 06, 2010 7:38 pm

Can some one suggest what if I wish to delete only members starting with "E"?
Eg: MBOLT.MTEMPX.M7AWXX.DATA04(E*)
I mean to ask here, is it possible to specify Wildcard in IDCAMS or any other IBM utility.

At the same time in case if there is solution to above, is it possible to apply the same to Flat files as well?
Eg: MBOLT.MTEMPX.M7AWXX.D*
Thanks Always,
-Rupesh.
cvrupesh
 
Posts: 20
Joined: Tue Jun 02, 2009 9:59 am
Location: Bangalore
Has thanked: 0 time
Been thanked: 0 time

Re: DELETE members

Postby NicC » Thu Oct 07, 2010 12:06 am

Suggest a read of the relevant part of the AMS manual. It is all in there.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post