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
 

 

How to 'lock' a PDS member...

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Josh Keller

New User


Joined: 08 Oct 2007
Posts: 36
Location: Columbia, SC

PostPosted: Tue Oct 09, 2007 9:57 pm    Post subject: How to 'lock' a PDS member...
Reply with quote

I'm created a REXX panel that will allow users to edit a formated PDS member, however I can't use ISPEXEC EDIT DATASET because the user
doesn't have to modify all records.

The pds where these members are located is a shared PDS, so multiple
users have access.


The question here is how do I allocate a single PDS member without
locking the entire PDS so that only one user can edit that
member...just like ISPEXEC EDIT DATASET does.


Here's what's I've tried:


I used ALLOC with MOD and OLD disposition, but that locks out the PDS
from additional ALLOCs, so that was no good.


I used LMINIT/LMOPEN/LMMFIND to get a member as ENQ(EXCLU) but that did not lock out the member. The closest I got was when I tried
ENQ(SHRW) and it would open the member once, but when I tried to open
it again, my session would freeze when I tried to open as output.
(see below) I wait until the user exits to perform my LMCLOSE and LMFREE.


I've ran QUERYENQ but it only lists the PDS and not the member while
the member is allocated.


I'd be happy with a way to determine if that member was already open in
my REXX, but idealy I want to open the member in my REXX, and ISPEXEC
EDIT DATASET would detect the member as already being edited.


I feel like I'm close, but missing one bit of the puzzle.


Code:
ADDRESS "ISPEXEC"
  "LMINIT  DATAID("DIDAPS") DATASET('"PDS"') ENQ(SHRW)"
  "LMQUERY DATAID("DIDAPS") PROJECT(PRJV) GROUP1(GRP1V)",
                 "GROUP2(GRP2V) GROUP3(GRP3V) GROUP4(GRP4V)",
                 "TYPE(TYPEV) "


  "LMOPEN  DATAID("DIDAPS") OPTION(INPUT)"
  "LMMFIND DATAID("DIDAPS") MEMBER("MBR")",
  "                 LRECL(LENVAR)  RECFM(FORMVAR)",
  "                 GROUP(GRPVAR) "



Thanks for any help.
Back to top
View user's profile Send private message

cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Tue Oct 09, 2007 10:51 pm    Post subject:
Reply with quote

I use something like this. Let's call this REXXPGM.

Code:

/*************************REXX*******************/ 
PARSE UPPER ARG MEMBER                                               
DSN1= "('HLQ.PDS.DATASET')"                                           
IF JOBFIND ¬= "" THEN SIGNAL FINDMEM                                 
ISPEXEC "EDIT DATASET"||DSN1                                           
EXIT                                                                   
FINDMEM:                                                               
   DSN1= "('HLQ.PDS.DATASET("||MEMBER||")')"                         
   ISPEXEC "EDIT DATASET"||DSN1                                       
   EXIT                                                               
END                                                                   


If you want to view the whole PDS, you enter TSO REXXPGM.

If you want to view a specific member, you enter TSO REXXPGM MEMNAME.

If you want to view all member starting with PROG, you enter TSO REXXPGM PROG*.

There has never been any contention issues with this setup.
Back to top
View user's profile Send private message
Josh Keller

New User


Joined: 08 Oct 2007
Posts: 36
Location: Columbia, SC

PostPosted: Wed Oct 10, 2007 8:46 pm    Post subject: Reply to: How to 'lock' a PDS member...
Reply with quote

As an update, I found a service called ENQ (this particular one is part of REXXTOOLS, but I think there is a MVS version as well). This allowed me to add an entry to the ENQ table manually in the same manner ISPEXEC EDIT does. I was able to test to see if the member was already on this table prior to allocating in my rexx, and therefore was able to handle my situation. However, although I added it under the SPFEDIT ENQ, ISPEXEC EDIT stil let me edit it, and it too would add an entry in the table. That's not that big of a deal, but still a bit odd...


Here's the code for anyone who may come across this situation.


Code:
ENQREC = PDS||COPIES(' ',44 - LENGTH(PDS))||MEMBER
CALL ENQ 'SPFEDIT', ENQREC, 'E', 'SYSTEMS', 'TEST'
IF RC >= 4  THEN DO
   SAY "MEMBER IS IN USE, OR COULD NOT BE OPEN"
   EXIT 9
END
CALL ENQ 'SPFEDIT', ENQREC, 'E', 'SYSTEMS'
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


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