IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how can jcl delete the ps even if it is in exclusive lock


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nabarun

New User


Joined: 27 Apr 2005
Posts: 13
Location: india

PostPosted: Tue Jan 09, 2007 3:58 pm
Reply with quote

HI,
I hv a query about the following JCL

//XYZ EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//PDS DD DSN=userid.NABA.COB,DISP=SHR
//SYSIN DD *
ALLOC DDN(ABC) SHR REUSE DSN ('userid.NABA.COB' )
DELETE userid.NABA.COB(ABC) FILE(PDS)
/*
//

IF WE USE THE ABOVE JCL THEN WE CAN DELETE THE PS EVEN IF SOMONE USING IT(EXCLUSIVE CONTROL).

HOW IS IT POSSIBLE???? THEN WHT IS THE MEANING OF EXCLUSIVE LOCK?????? PLZ EXPLAIN ME

when i run the JCL i opened the file in edit mode by using 3.4
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jan 10, 2007 4:52 am
Reply with quote

Hello,

What do you want to happen if the dataset IS in use - or do you mean the member?

If you replace the IDCAMS step with IEFBR14/IEBGENER step(s) you can do whatever you need and will be protected if the dataset is in use.

Quote:
HOW IS IT POSSIBLE???? THEN WHT IS THE MEANING OF EXCLUSIVE LOCK??????


Most likely this happened because you allocated the dataset with SHR. If you want an exclussive lock, try OLD. You also mentioned:
Quote:
IF WE USE THE ABOVE JCL THEN WE CAN DELETE THE PS EVEN IF SOMONE USING IT(EXCLUSIVE CONTROL).


This is not really a PS, but a member of a PO (partioned organization - PDS).

If i totally missed the question, please let me know and i'll try again.
Back to top
View user's profile Send private message
nabarun

New User


Joined: 27 Apr 2005
Posts: 13
Location: india

PostPosted: Wed Jan 10, 2007 10:07 am
Reply with quote

hi dick,

by using 3.4 if we open a member in edit mode and try to delete it from another screen it will give "dataset in use". so when the above jcl runs why it is not giving the same message?? and logically speaking this should delete the member. it should also give "dataset in use". and could you plz explain me the JCL step

ALLOC DDN(ABC) SHR REUSE DSN ('userid.NABA.COB' ) and wht is it doing actually..

regards,
nabarun
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 11, 2007 6:04 am
Reply with quote

Hi Nabarun,

Quote:
ALLOC DDN(ABC) SHR REUSE DSN ('userid.NABA.COB' ) and wht is it doing actually..


This statement allocates the named dataset for use in "this" utility step. Changing the 'SHR' to 'OLD' may prevent the deletion, but may "wait" until it is canceled or the dataset is released online.

Is this an experiment or is there something you need to do?

Is there a chance that the IDCAMS ran on a different mainframe (do you have shared dasd?)? I've seen places where cross-system dataset enqueues had problems.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts DELETE SPUFI DB2 1
No new posts DSNTIAUL driven delete IBM Tools 0
No new posts Lock Escalation DB2 3
No new posts How to delete a user's alias from the... JCL & VSAM 11
No new posts Delete file row if blanks in the firs... DFSORT/ICETOOL 5
Search our Forums:

Back to Top