Skip to main content

on a READU the STATUS() function is returning the incorrect value for the userno if the record is locked but a phantom.  Instead of a negative number is returns the number without the minus sign.  Has this been addressed ?

0001:       OPEN '','INCIDENT' TO FILE THEN                                     
0002:          READU X FROM FILE,'21333' LOCKED                                 
0003:             PRINT STATUS()                                                
0004:          END ELSE                                                         
0005:          END                                                              
0006:       END                                                                 
0007: END               

 ? LR                                                                           
Account  File        UNO  PID   User       Record Id            Date  Time      
-------------------- ---- ----- ---------- -------------------- --------------  
KOPS     INCIDENT    -8   9324  miked      21333 (2400045)      01/29 11:36:29  

? RUN BP T                                                                     
8         



------------------------------
Michael Deperro
Director of Safety
Keystone Information Systems
Maple Shade NJ US
------------------------------

on a READU the STATUS() function is returning the incorrect value for the userno if the record is locked but a phantom.  Instead of a negative number is returns the number without the minus sign.  Has this been addressed ?

0001:       OPEN '','INCIDENT' TO FILE THEN                                     
0002:          READU X FROM FILE,'21333' LOCKED                                 
0003:             PRINT STATUS()                                                
0004:          END ELSE                                                         
0005:          END                                                              
0006:       END                                                                 
0007: END               

 ? LR                                                                           
Account  File        UNO  PID   User       Record Id            Date  Time      
-------------------- ---- ----- ---------- -------------------- --------------  
KOPS     INCIDENT    -8   9324  miked      21333 (2400045)      01/29 11:36:29  

? RUN BP T                                                                     
8         



------------------------------
Michael Deperro
Director of Safety
Keystone Information Systems
Maple Shade NJ US
------------------------------

Hi

Internally, userno is the index id into the LCT, with phantom it's not anymore the OS PID (negate). 

I suggest to use the USERINFO() func to read the detail about a session {user, type, nature, path,...)

I hope this help. 



------------------------------
Manu Fernandes
------------------------------

on a READU the STATUS() function is returning the incorrect value for the userno if the record is locked but a phantom.  Instead of a negative number is returns the number without the minus sign.  Has this been addressed ?

0001:       OPEN '','INCIDENT' TO FILE THEN                                     
0002:          READU X FROM FILE,'21333' LOCKED                                 
0003:             PRINT STATUS()                                                
0004:          END ELSE                                                         
0005:          END                                                              
0006:       END                                                                 
0007: END               

 ? LR                                                                           
Account  File        UNO  PID   User       Record Id            Date  Time      
-------------------- ---- ----- ---------- -------------------- --------------  
KOPS     INCIDENT    -8   9324  miked      21333 (2400045)      01/29 11:36:29  

? RUN BP T                                                                     
8         



------------------------------
Michael Deperro
Director of Safety
Keystone Information Systems
Maple Shade NJ US
------------------------------

And I'll check if r14 return positive or negative number. 

Regards 



------------------------------
Manu Fernandes
------------------------------

Hi

Internally, userno is the index id into the LCT, with phantom it's not anymore the OS PID (negate). 

I suggest to use the USERINFO() func to read the detail about a session {user, type, nature, path,...)

I hope this help. 



------------------------------
Manu Fernandes
------------------------------

Yes, USERINFO will get me what I need.  Thank you for the help!



------------------------------
Michael Deperro
Director of Safety
Keystone Information Systems
Maple Shade NJ US
------------------------------

on a READU the STATUS() function is returning the incorrect value for the userno if the record is locked but a phantom.  Instead of a negative number is returns the number without the minus sign.  Has this been addressed ?

0001:       OPEN '','INCIDENT' TO FILE THEN                                     
0002:          READU X FROM FILE,'21333' LOCKED                                 
0003:             PRINT STATUS()                                                
0004:          END ELSE                                                         
0005:          END                                                              
0006:       END                                                                 
0007: END               

 ? LR                                                                           
Account  File        UNO  PID   User       Record Id            Date  Time      
-------------------- ---- ----- ---------- -------------------- --------------  
KOPS     INCIDENT    -8   9324  miked      21333 (2400045)      01/29 11:36:29  

? RUN BP T                                                                     
8         



------------------------------
Michael Deperro
Director of Safety
Keystone Information Systems
Maple Shade NJ US
------------------------------

At 12.x and higher, the STATUS() function inside the LOCKED clause currently returns the absolute value of the user number. Basically it is returning the slot position of the user in the LCT table. Background users are not prefixed with a negative sign.

If additional information on the user is required, one suggestion is to use the USERINFO() function inside the LOCKED clause with the result of the STATUS() function. See example below with the following program named CHECKIT.

DYNARRAY = ''
OPEN 'VOC' TO F.FILE ELSE STOP 'CANNOT OPEN VOC'
READU REC FROM F.FILE,'LIST' LOCKED
LOCKED.BY = STATUS()
CRT "LOCKED BY = ":LOCKED.BY
X = USERINFO(4,LOCKED.BY,DYNARRAY)
CRT DYNARRAY
END ELSE
CRT 'CANNOT READ LIST'
END
END

>RUN BP CHECKIT
LOCKED BY = 202
-202ýrootý8585658ü10027412ýPhantomý0ýphantomýN/Aý/disk1/testarea/npmýMon Jan 29
08:55:01 2025ý20385ý32101ý20385ý46501



------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
------------------------------

At 12.x and higher, the STATUS() function inside the LOCKED clause currently returns the absolute value of the user number. Basically it is returning the slot position of the user in the LCT table. Background users are not prefixed with a negative sign.

If additional information on the user is required, one suggestion is to use the USERINFO() function inside the LOCKED clause with the result of the STATUS() function. See example below with the following program named CHECKIT.

DYNARRAY = ''
OPEN 'VOC' TO F.FILE ELSE STOP 'CANNOT OPEN VOC'
READU REC FROM F.FILE,'LIST' LOCKED
LOCKED.BY = STATUS()
CRT "LOCKED BY = ":LOCKED.BY
X = USERINFO(4,LOCKED.BY,DYNARRAY)
CRT DYNARRAY
END ELSE
CRT 'CANNOT READ LIST'
END
END

>RUN BP CHECKIT
LOCKED BY = 202
-202ýrootý8585658ü10027412ýPhantomý0ýphantomýN/Aý/disk1/testarea/npmýMon Jan 29
08:55:01 2025ý20385ý32101ý20385ý46501



------------------------------
Neil Morris
Universe Advanced Technical Support
Rocket Software
------------------------------

Thank you for the help.



------------------------------
Michael Deperro
Director of Safety
Keystone Information Systems
Maple Shade NJ US
------------------------------