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
 

 

Deleting a member of a dataset through a jcl job

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

New User


Joined: 19 Apr 2007
Posts: 37
Location: Bangalore

PostPosted: Thu Sep 11, 2008 3:01 pm    Post subject: Deleting a member of a dataset through a jcl job
Reply with quote

Hi ,

How can we delete a member in a dataset through a JCL job, not manually.



Thanks...
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: Thu Sep 11, 2008 3:02 pm    Post subject:
Reply with quote

Look at IDCAMS DELETE
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Sep 11, 2008 3:10 pm    Post subject: Reply to: Deleting a member of a dataset through a jcl job
Reply with quote

Abhishek,

Got this after a search. See if it helps.

SCRATCH.





But best way is to follow what Expat had suggested.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Sep 11, 2008 4:51 pm    Post subject:
Reply with quote

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

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Thu Sep 11, 2008 5:20 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Sep 11, 2008 5:27 pm    Post subject:
Reply with quote

Hi,

you can always use IEHPROGM


Gerry
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Thu Sep 11, 2008 8:12 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Sep 12, 2008 3:27 am    Post subject:
Reply with quote

Hi Bill.

I have to disagree with you Bill, IEHPROGM does not require exclusive control.

Gerry
Back to top
View user's profile Send private message
abhishek dadhichi

New User


Joined: 19 Apr 2007
Posts: 37
Location: Bangalore

PostPosted: Fri Sep 12, 2008 9:58 am    Post subject: Reply to: Deleting a member of a dataset through a jcl job
Reply with quote

Hi..

I tried with IDCAMS DELETE and it worked for me..Thanks all for the quick response..



Thanks..
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Sep 12, 2008 11:11 am    Post subject: Reply to: Deleting a member of a dataset through a jcl job
Reply with quote

Good that it is working and thanks for the follow-up.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Fri Sep 12, 2008 2:37 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Sep 12, 2008 2:44 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Fri Sep 12, 2008 2:45 pm    Post subject: Reply to: Deleting a member of a dataset through a jcl job
Reply with quote

Genesis,

Quote:
can u please give an example of the jcl.. i couldn't find in the manual..


Check the manual links shown below.

IEHPROGM EXAMPLES

Below link is for the OP's requirement

IEHPROGM - DELETING A MEMBER
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 Sep 12, 2008 2:46 pm    Post subject:
Reply with quote

Gerry - Are you sure that you should use DISP=OLD for the VOL1 DD ?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Sep 12, 2008 3:01 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Sep 12, 2008 3:20 pm    Post subject:
Reply with quote

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

Global Moderator


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

PostPosted: Fri Sep 12, 2008 3:27 pm    Post subject:
Reply with quote

OK, I trust you, just curious icon_wink.gif
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Tue Sep 23, 2008 7:20 pm    Post subject:
Reply with quote

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
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am
No new posts dataset copy question - REPRO or some... atulxp TSO/ISPF 2 Wed Aug 03, 2016 10:56 pm


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