I use a (borrowed) program that relies on GETREADU() (Unidata)

GETREADU

Syntax
GETREADU()

Description
The UniBasic GETREADU function returns a dynamic array containing 
information about all
records that have been locked by any UniBasic or ECL command that updates 
any record.
This command delivers the same information as the ECL command LIST.READU, 
but in a different
format. A value mark separates these pieces of information. An attribute 
mark separates the
information about different locks. The number of locks is returned in
@SYSTEM.RETURN.CODE.

AE BP REC.LOCKS
Top of "REC.LOCKS" in "BP", 41 lines, 1,183 characters.

001: *------------------------------ REC.LOCKS -------------------------------
002: PROMPT ''
003: R.PH = GETREADU()
004: P = -1
005: Y = 25
006: PRINT @(-1):
007: MAX = COUNT(R.PH,@FM) + (R.PH # '')
008: IF MAX >= 1 THEN
009:   FOR CNT = 1 TO MAX
010:     Y += 1
011:     IF Y > 21 THEN
012:       P += 1
013:       IF P > 0 THEN
014:         PRINT @(0,23):'RETURN TO CONTINUE :':
015:         INPUT CR
016:         IF CR[1,1] = 'S' OR CR[1,1] = 'Q' OR CR[1,1] = 'E' THEN
017:           PRINT
018:           STOP
019:         END
020:       END
021:       Y = 2
022:       PRINT @(-1):'***  RECORD LOCKS  ***'
023:       PRINT 'UID PT LOGINS.. FILE NAME........... ':
024:       PRINT 'RECORD KEY.......... ..TIME.. ...DATE....'
025:     END
026:     PORT = FIELD(R.PH<CNT,5>,'/',2,1)
027:     FPOS = COUNT(R.PH<CNT,6>,'/') + (R.PH<CNT,6> # '')
028:     FNAME = FIELD(R.PH<CNT,6>,'/',FPOS,1)
029:     PRINT @(0,Y):FMT(R.PH<CNT,3>,'R#3'):' ':FMT(PORT,'R#2'):
030:     PRINT ' ':FMT(R.PH<CNT,4>,'L#8'):' ':FMT(FNAME,'L#20'):
031:     PRINT ' ':FMT(R.PH<CNT,9>,'L#20'):' ':FMT(R.PH<CNT,11>,'R#8'):
032:     PRINT ' ':FMT(R.PH<CNT,12>,'L#12')
033:   NEXT CNT
034: END ELSE
035:   PRINT @(-1):'* * *  RECORD LOCKS  * * *'
036:   PRINT
037:   PRINT '---->  No locks to report  <----'
038:   PRINT
039: END
040: END
041: *------------------------------------------------------------------------
Bottom.


Output example:
***  RECORD LOCKS  ***
UID PT LOGINS.. FILE NAME........... RECORD KEY.......... ..TIME.. ...DATE....
288  6 honarya  FIXED.ASSETS         6846                 07:50:49 Aug 05 2005
313  4 cash     RCPT.SESSIONS        2372                 07:52:19 Aug 05 2005


At 01:03 AM 8/4/2005, Pankaj Gupta04 wrote:
>Hi All,
>I have some records which are locked. The Item ID is same. Can I get the
>database filename to which the records belong?
>I am using Universe at unix platform.
>The output of LIST.READU is given below:
>
> >LIST.READU
>
>Active Record Locks:
>
>Device.... Inode....  Netnode Userno  Lmode   Pid Login Id
>Item-ID.............
>   34485434      9968        0  55990   9 RU  9546 appsadm  GGB1010300001
>   34485434      9964        0  37921  12 RU 27615 appsadm  CCB1011300764
>   34485433    478438        0  60553  17 RU  4983 appsadm  HHB1010300083
>   34485433    478423        0  36137  31 RU 29399 appsadm  GGB1010300001
>   34485434      9969        0  52754  63 RU 12782 appsadm  FFB1010300015
>   34485434      9991        0  53543 102 RU 11993 appsadm  GGB1010300001
>   34485434      9964        0  50360 107 RU 15176 appsadm  GGB1010300001
>   34485434     10391        0  47313 121 RU 18223 appsadm  GGB1010300001
>
>
>
>Regards,
>
>Pankaj Gupta


*-----------------------------------------------------------*
                         Jon Wells
Database Administrator                         Beloit College
Information Services & Resources            Beloit, Wisconsin
608-363-2290        [EMAIL PROTECTED]       608-363-2100(fax)
*-----------------------------------------------------------*
AIX 5.1.3          IBM RS6000 F50               UniData 6.0.8
*-----------------------------------------------------------*
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to