So can you PARSE the LISTUSER() function output using @USERNO (which should
be your PID) to find the relevant attribute for your license and digging out
the appropriate values which identifies your process type.

Alternatively, since it looks like you'd need to check two elements in that
array, perhaps just use @USER.TYPE and then check if @TTY is not equal to
"udcs" - which appears to be a clear indicator of a UniObjects invoked
program.

Or is the problem that you need to know the difference between a program
that has been PHANTOMed out of UniObjects and one that has been PHANTOMed
straight from a command prompt?

HTH,

Ken

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bill Haskett
Sent: Tuesday, 16 September 2008 12:54 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] [UD] Determining if program running as a phantom

Im having a bit of a problem figuring out how to tell, within a program, if
it is running as a phantom.  It was my impression that @USER.TYPE would be
set to 1 if the program was running as a phantom.  However, if I run a
program from a UniObjects connection @USER.TYPE is always set to 1.  It
doesnt matter I test this within the main program that EXECUTEs a phantom
or within the phantomed program.   If I test @TTY then it returns udcs
from within the main program or Console from within the phantomed program
(I hate to think this is how I determine if a program is running as a
phantom ).



If I execute the LISTUSER() function then the line properly shows the user
type as a phantom.



The phantomed process.

*--: p

001: @USER.TYPE-: 1

002: @TTY-------: Console

003: PORT.NO----: 6

004: LISTUSER()-: 12251621976152myuser2phantom2pts/12Console210:33:322Sep 15
2008

005: 2263221976152myuser2udt2pts/22192.168.1.51216:41:202Sep 15 2008

006: 32383621976152myuser2udt2pts/32192.168.1.51215:11:522Sep 15 2008

007: 42358421976402designbai2udt2pts/42udcs219:30:062Sep 15 2008

008: 52337621976152myuser2udt2pts/52192.168.1.51215:31:312Sep 15 2008

009: 62238821976402designbai2phantom2pts/62Console219:30:532Sep 15 2008

010: ...Entry DEV_DESIGNBAIS_6_1486970254.txt

011: ...Entry DEV_DESIGNBAIS_6_1486970255.txt

013: PHANTOM process 2388 has completed.

Bottom.



The process executing the above phantomed job

*--: p

001: E:\DataTrust\Dev\_PH_\O_designbais established

002: @USER.TYPE-: 1

003: @TTY-------: udcs

004: PORT.NO----: 4

005: LISTUSER()-: 12251621976152myuser2phantom2pts/12Console210:33:322Sep 15
2008

006: 2263221976152myuser2udt2pts/22192.168.1.51216:41:202Sep 15 2008

007: 32383621976152myuser2udt2pts/32192.168.1.51215:11:522Sep 15 2008

008: 42358421976402designbai2udt2pts/42udcs219:30:062Sep 15 2008

009: 52337621976152myuser2udt2pts/52192.168.1.51215:31:312Sep 15 2008





Ive resorted to parsing the results of LISTUSER() to get what appears to be
the correct information.  Does anyone know of an easier alternative.



Thanks,

Bill Haskett
Advantos Systems, Inc.
4370 La Jolla Village Drive, Suite 400
San Diego, CA  92122
(  760-944-5570 x3000 (CA)
(  360-923-4838 (WA)
-------
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/

Reply via email to