MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delete Members in a dataset

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Mon Aug 11, 2008 8:19 am    Post subject: Delete Members in a dataset Reply with quote

Hi,

We have a common dataset, lets say DATASET.TEST.MEMBERS. We used to process some members and manually delete it. Then it was automated using a code which automatically deletes it if processed successfully. When I saw the dymamic code it was like this

//DEL0001 EXEC PGM=IDCAMS,COND=(5,LE)
//SYSPRINT DD SYSOUT=*
DELETE DATASET.TEST.MEMBERS(MEM1)
IF MAXCC EQ 8 THEN SET MAXCC = 0
/*

Problem here is, if any one is present inside this dataset, the member is not getting deleted when the code runs.
Can we have a solution in IDCAMS, where the members can be deleted even if the dataset is accessed by anyother user?
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Aug 11, 2008 9:26 am    Post subject: Reply with quote

I think IDCAMS DELETE allocates datasets DISP=OLD; at least it does when invoked as a TSO command.

You could use ISPF services LMINIT, LMOPEN, LMMDEL, LMFREE in a Rexx exec that you run in batch. LIMINIT with the ENQ(SHRW) operand will let you do this while others have the data set open in ISPF, unless, of course, they are editing a member you are trying to delete.

Remember that to run ISPF services in batch, your JCL needs the ISPF libraries allocated to it. Look at BATCHPDF for an example of how to set this up at your site (use your favorite search engine to find it).
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group