View previous topic :: View next topic
|
Author |
Message |
abhishek dadhichi
New User
Joined: 19 Apr 2007 Posts: 37 Location: Bangalore
|
|
|
|
Hi ,
How can we delete a member in a dataset through a JCL job, not manually.
Thanks... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Look at IDCAMS DELETE |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Abhishek,
Got this after a search. See if it helps.
SCRATCH.
But best way is to follow what Expat had suggested. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
the only thing I don't like about IDCAMS is that if the dataset is in use (not the member), the job fails as it wants exclusive access to the dataset
IKJ56225I type ALREADY IN USE, TRY LATER + DATA SET IS ALLOCATED TO
ANOTHER JOB OR USER
Gerry |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
even IKJEFT01 gives the same error message IKJ56225I when trying to delete the member of an allocated dataset.
something to do with address spaces? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you can always use IEHPROGM
Gerry |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
IEHPROGM also requires exclusive control.
Our solution was to write a utility that did ISPF-like END/DEQ around the delete. This allowed DISP=SHR to share the PDS with the TSO community. The ISPF Edit Guide describes the ENQ resource names. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Bill.
I have to disagree with you Bill, IEHPROGM does not require exclusive control.
Gerry |
|
Back to top |
|
|
abhishek dadhichi
New User
Joined: 19 Apr 2007 Posts: 37 Location: Bangalore
|
|
|
|
Hi..
I tried with IDCAMS DELETE and it worked for me..Thanks all for the quick response..
Thanks.. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Good that it is working and thanks for the follow-up. |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
hi gcicchet,
Quote: |
I have to disagree with you Bill, IEHPROGM does not require exclusive control. |
can u please give an example of the jcl.. i couldn't find in the manual.. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
tested example below
Code: |
//SCRATCH EXEC PGM=IEHPROGM
//SYSPRINT DD SYSOUT=*
//VOL1 DD UNIT=SYSDA,VOL=SER=DEV012,DISP=OLD
//SYSIN DD *
SCRATCH DSNAME=CSCSGLC.PDS1,VOL=SYSDA=DEV012,MEMBER=AA
/*
|
Gerry |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Gerry - Are you sure that you should use DISP=OLD for the VOL1 DD ? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Expat,
the example I managed to dig up amongst some of my old JCL had DISP=OLD, I can't remember the exact reason for it but something tells me there was a reason for it although DISP=SHR seems to work ok.
I googled for some examples and sure enough, I found this example
Code: |
//DELMEM EXEC PGM=IEHPROGM
//SYSPRINT DD SYSOUT=*
//VOLUME DD UNIT=SYSDA,VOL=SER=MYVOL1,DISP=OLD
//SYSIN DD *
SCRATCH DSNAME=MY.MEMBER.DATASET,VOL=SYSDA=MYVOL1,MEMBER=MYMEMBER
/*
|
This step deletes member MYMEMBER in dataset MY.MEMBER.DATASET if the member exists and if the dataset is located on volume MYVOL1. It is very irritating that you have to find out which volume the dataset is located on prior to execution of the job. It is in fact pretty ludicrous because you almost never worry about which volume a dataset is located on. IEHPROGM is the only IBM utility program that is able to delete members, so you have to care about volumes, if you want to use this program. The input line in SYSIN can be repeated as many times as you have members to delete, then all you need is to change the member names. This is straight forward if you have a list of the members to be deleted in another dataset or member.
Other examples had DISP=SHR
Gerry |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Expat,
IBM manual shows all the examples with DISP=OLD
15.10.7 Example 7: Rename a Partitioned Data Set Member
In this example, a member of a partitioned data set is renamed.
//REN JOB ...
//STEP1 EXEC PGM=IEHPROGM
//SYSPRINT DD SYSOUT=A
//DD1 DD VOL=SER=222222,DISP=OLD,UNIT=disk
//SYSIN DD *
RENAME VOL=disk=222222,DSNAME=DATASET,NEWNAME=BC,MEMBER=ABC
/*
The control statements are discussed below:
DD1 DD defines a permanently mounted volume.
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
OK, I trust you, just curious |
|
Back to top |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
found another way to do this using IDCAMS:
Code: |
//DELMEM EXEC PGM=IDCAMS,REGION=5M
//SYSPRINT DD SYSOUT=*
//PDS DD DSN=MY.GENERAL.CLIST,DISP=SHR
//SYSIN DD *
ALLOC DDN(INFILE) SHR REUSE DSN('MY.GENERAL.CLIST')
DELETE MY.GENERAL.CLIST(MEM1) FILE(PDS)
/*
|
|
|
Back to top |
|
|
|