Page 1 of 3

DELETE members

PostPosted: Wed Sep 16, 2009 11:53 am
by manesg
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

Re: DELETE members

PostPosted: Wed Sep 16, 2009 2:42 pm
by expat
If you want to delete all members, why not just delete / define the whole PDS

Re: DELETE members

PostPosted: Sun Sep 20, 2009 6:18 pm
by manesg
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)

Re: DELETE members

PostPosted: Mon Sep 21, 2009 2:43 am
by dick scherrer
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?

Re: DELETE members

PostPosted: Mon Sep 21, 2009 6:18 pm
by manesg
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.

Re: DELETE members

PostPosted: Tue Sep 22, 2009 12:03 am
by dick scherrer
You're welcome - good luck :)

d

Re: DELETE members

PostPosted: Wed Dec 02, 2009 12:17 pm
by manesg
Thanks Dick.
It worked. No issues.
Thanks again for pointing me to right direction.

Re: DELETE members

PostPosted: Thu Dec 03, 2009 4:02 am
by dick scherrer
Good to hear it worked - thanks for letting us know :)

d

Re: DELETE members

PostPosted: Wed Oct 06, 2010 7:38 pm
by cvrupesh
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*

Re: DELETE members

PostPosted: Thu Oct 07, 2010 12:06 am
by NicC
Suggest a read of the relevant part of the AMS manual. It is all in there.