Hi Susan. You're in UD and I'm coming from a UV system so your mileage may vary.
LIST.LOCKS is just a semaphore table, not an actual listing of record locks. The LOCK command is used for setting the entries in that table. Not seeing your code snippet, I offer this in an attempt to present my knowledge on this subject: OPEN 'filename' TO FILE.HANDLE ELSE GOTO Z999.EXIT KEY = 'key.value' READU DATA.RCD FROM FILE.HANDLE, KEY LOCKED PRINT 'PROCESS ID ':STATUS():' HAS ':KEY:' LOCKED. ABORTING.' GOTO Z999.EXIT END THEN PRINT 'DATA RECORD FOUND AND LOCKED.' END ELSE PRINT 'NEW DATA RECORD. KEY LOCKED.' END DATA.RCD<-1>='New Field Added' WRITE DATA.RCD ON FILE.HANDLE, KEY Z999.EXIT: END You can then use LISTU to find the process id in the USER NO column and the user login id in the USER NAME column for that process. For LIST.LOCKS, I use that to help me keep track of what PHANTOMS are running. In the phantom program I use something similar to: LOCK.ID = 15 LOCK LOCK.ID THEN PRINT "PHANTOM STARTED AT ":TIMEDATE() END ELSE PRINT "PHANTOM IS ALREADY RUNNING." GOTO Z999.EXIT END * DO STUFF HERE. ... UNLOCK LOCK.ID Z999.EXIT: PRINT "PROCESS ENDED AT ":TIMEDATE() END This will give me an entry in &PH& each time the phantom starts and stops. The number 15 is just a number I picked out the air to be associated with this specific phantom. When I LIST.LOCKS, I'll see my process ID, unless I'm in the Administrators group, then I'll just see a zero in that "slot". If the phantom dies, for any reason, that session closes and releases the lock. If the phantom shuts down normally, it also releases that lock. Hope that helps. Bob W > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:owner-u2- > [EMAIL PROTECTED] On Behalf Of Susan Joslyn > Sent: Thursday, April 14, 2005 8:33 AM > To: u2-users@listserver.u2ug.org > Subject: [U2] Locks, releases and STATU() (oh my) > > Hello wizards, > > I've read what I can find on the subject, but I'm not finding what I need. > As usual, anyone who knows where the info is, I would not be the least bit > offended if you just point. Or if you know off-hand ... > > (Presently grappling with Unidata): > > When I hit a lock with a: > READU this FROM that,ID LOCKED locked clause ELSE whatever > > LIST.LOCKS from TCL has always been worse than useless for me. For > example > at this exact moment I'm holding locks on 3 sessions, yet if I run > LIST.LOCKS on a 4th session it displays ABSOLUTELY NOTHING. > > I don't see much on offer in the LOCKED clause, although the online help > suggests that STATUS() will return the user number of the lock it ran > into. > Can't understand its output... I have a very short program that displays > STATUS(), opens the file and displays STATUS() then does a READU against > an > item I purposefully have locked on another session and I display STATUS() > a > third time. What do you suppose its giving me, and what can I do with it? > > 1 STATUS = 0 <-- beginning of program > 2 STATUS = 1 <-- after the open > 3 STATUS = 197613 <-- this is what it gives me after the READU against a > locked item > > What I want to do is determine who/what has the lock, tell the user, I > also > want to be able to carry on under my own conditions when ud 46 flag is set > which will by default allow edits to items I've locked against my own > session. Which is too loose -- I want to check to make sure I'm in the > exact right condition to do that and I'm not sure how I can (by seeing > what > is holding the lock) but ... does anyone know how to get ANY information > out > of a lock? > > Susan > ------- > u2-users mailing list > u2-users@listserver.u2ug.org > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/