We are running Avante, on Universe, on HPUX so I developed this small
program to grab the LIST.READU output, locate the filenames (it only
looks at production files) and display the lines with the filenames.
Since the part number is also an important field for us, I display it
rather then the internal part number.
Here is the program-
FINDCMD="CSH -c 'find /usr/igi/flodata/live/LIVE.DATA -inum "
INUMS=""
FNAMS=""
IMOPEN=0
IF @WHO = "uv" THEN QPTR="ITMMST.PROD" ELSE QPTR="ITMMST"
OPEN "VOC" TO MYVOC ELSE GOTO 10
READ VOCREC FROM MYVOC,QPTR ELSE GOTO 10
CLOSE MYVOC
OPEN QPTR TO IMFILE ELSE GOTO 10
IMOPEN=1
10
GOTRECLOCK=0
EXECUTE "LIST.READU EVERY" CAPTURING XX
NXX=DCOUNT(XX,@AM)
FOR I=1 TO NXX
YY=XX<I>
* Sample -
* 1073807361 31463 0 257 23 RU 13667 JOEUSER G000396500
* Active Read Waiters: Owner Waiter
* Device.... Inode.... Userno Userno
* 1073807363 11400 88 145
FIRST19=YY[1,19]
IF FIRST19 = "Active Record Locks" THEN GOTRECLOCK = 1
IF GOTRECLOCK = 0 THEN CONTINUE
IF FIRST19 = "Active Read Waiters" THEN GOTRECLOCK = 2
IF GOTRECLOCK = 2 THEN GOTO 30
ZZ=YY[11,10]
VV=""
LOCATE(ZZ,INUMS;LOC1;"AL") THEN VV=FNAMS<LOC1> ; GOTO 20
IF NUM(ZZ) THEN EXECUTE FINDCMD:ZZ:"'" CAPTURING WW
ELSE WW=""
IF WW # "" THEN
UU=DCOUNT(WW,"/")
VV=WW["/",UU,1]
VV=VV<1>
END
INS ZZ BEFORE INUMS<LOC1>
INS VV BEFORE FNAMS<LOC1>
20
IF VV # "" THEN
IF VV = "ITMMST" OR VV = "INVPLAN" THEN
IF IMOPEN THEN
THEKEY=YY[60,5]
READV PARTNBR FROM IMFILE,THEKEY,1 ELSE PARTNBR="NO IM"
YY[LEN(PARTNBR)+4]=" (":PARTNBR:")"
END
END
VV:=" "
YY[1,20]=VV[1,20]
END
30
PRINT YY
NEXT I
I cataloged this globally for all "realms" to see.
-- Rod Hills
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Susan Joslyn
Sent: Thursday, April 14, 2005 8:33 AM
To: [email protected]
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
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/