That is different from universe where you get the error "@Variable (Read-only) unexpected" when you try to directly assign to @LOGNAME
-----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dan McGrath Sent: June 17, 2010 06:53 PM To: U2 Users List Subject: Re: [U2] @LOGNAME... Changing @variables I looked into this and there appears to be 2 different type of "system variables" in UniData. There are those like @AM which cannot be changed and those like @LOGNAME which can be. It is not required to pass them to a subroutine to change those that can be. A program will not compile if you assign to the first type. First type (Those that cannot be changed): @ACCOUNT @AM @COMMAND @CRTHIGH @CRTWIDE @DATA @GID @LASTVERB @LEVEL @LPTRHIGH @LPTRWIDE @PARASENTENCE @PATH @RM @SM @SVM @SYS.BELL @SYSTEM.RETURN.CODE @TM @TRANSACTION @TTY @UDTNO @UID @VM @WHO Second type (Those that can be freely changed): @CONV @DATE @DICT (This is actual usage. Documented) @FORMAT @HEADER @ID (This is actual usage. Documented) @LOGNAME @MONTH @RECORD (This is actual usage. Documented) @RECUR0 (This is actual usage. Documented) @RECUR1 (This is actual usage. Documented) @RECUR2 (This is actual usage. Documented) @RECUR3 (This is actual usage. Documented) @RECUR4 (This is actual usage. Documented) @TIME @USER0 (This is actual usage. Documented) @USER1 (This is actual usage. Documented) @USER2 (This is actual usage. Documented) @USER3 (This is actual usage. Documented) @USER4 (This is actual usage. Documented) @USER.RETURN.CODE (This is actual usage. Documented) @YEAR Regards, Dan -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of u2ug Sent: Friday, June 18, 2010 8:29 AM To: U2 Users List Subject: Re: [U2] @LOGNAME on Unidata We ran into a similar situation in the past with uv on hpux Although @LOGNAME is documented as a readonly value, we found out that it is possible to change it ( and other readonly system variables ) by passing it as an argument to a subroutine - the subroutine can then change the value. I guess uv doesn't actually mark the variable as readonly in any way at run time - readonliness is a compile time attribute - so a subroutine has no idea that its calling args are readonly system variables - so in effect they aren't. Look for any subroutines called with @LOGNAME as an argument then check that the sub doesn't alter that argument. Given : ... CALL *SOMESUB( @LOGNAME ) ... DEFINE SUBROUTINE SOMESUB ( ARG ) ... * this will change the argument value in the calling routine * including 'readonly' system variables ARG="Something" ... END Pass temp variable instead of @LOGNAME : CALL *SOMESUB( @LOGNAME:"" ) -or- CALL *SOMESUB( (@LOGNAME) ) -or- Ensure that argument is never modified in the routine -- DEFINE SUBROUTINE SOMESUB ( ARG.IN ) ARG=ARG.IN ;* the only place IARG is ever used ... ARG="SomethingElse" ... END Note that this also applies to functions and routines called via SUBR() and once the variable is changed it is changed for the lifetime of the current session not just for the current program. Gerry -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Jeffrey Butera Sent: June 17, 2010 02:04 PM To: U2 Users List Subject: [U2] @LOGNAME on Unidata We recently migrated from Unidata 7.1.8 on Solaris to Unidata 7.2.5 on RedHat. We make use of @LOGNAME quite a bit to determine a person's username. Since our migration, however, we've documented some cases where @LOGNAME is not returning the proper username - it returns someone else's. What's bizarre is that most of the time it's right, but occasionally it's not. Has anyone seen or heard of this? When we had a report of this (with documentation) I thought it was weird. Today we just got a call about a different problem which I'm 99% sure is tied to this since it makes use of @LOGNAME. Like the above, sometimes it's correct, sometime it's wrong. -- Jeff Butera, Ph.D. Manager of ERP Systems Hampshire College jbut...@hampshire.edu 413-559-5556 _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ ######################################################################## ################### The information transmitted in this message and attachments (if any) is intended only for the person or entity to which it is addressed. The message may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. The intended recipient of this e-mail may only use, reproduce, disclose or distribute the information contained in this e-mail and any attached files with the permission of IMB. ######################################################################## ################### _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users