When i look in a SAS log, there are 4 different Variables to grab User:
_METAPERSON
_METAUSER
_SECUREUSERNAME
_USERNAME
When i check the log, all 4 variables have the same value when i execute the process. So i builded a process which checked _Metauser for some specific user, so that only the users i wanted could do something. But a colleague of me had the problem that in the variable was not the username stored for him when he called the process, but username@Context. In the other 3 variables, there was only username stored for him, so maybe i can change to one of them. I can not use Metauser, because for some persons there could be an @Context after username.
No i have the problem, which variable to use? What is the difference between the 4 variables? Which to use, to be sure that i only (and always) get the pure username, no matter from where and which programm/Version the User is calling the process?
A stored process is a SAS program that is stored on a server and can be executed as required by requesting applications. You can use stored processes for Web reporting, analytics, building Web applications, delivering packages to clients or to the middle tier, and publishing results to channels or repositories.
The . sas file must reside in a directory that is registered with the server that executes the stored process. These directories are known as source code repositories. Source code repositories are managed using BI Manager.
Macro variables are stored in an area of memory known as symbol tables. Symbol tables simply hold in memory the macro variable name and its value.
The _SECUREUSERNAME macro variable is created when the application server executes a Stored Process. The value of _SECUREUSERNAME contains the client identity and this value will be written into the _USERNAME macro variable if _USERNAME doesn't already contain a value. Under most circumstances, the value of _SECUREUSERNAME will be the same as _USERNAME
_USERNAME Specifies the value for the user name obtained from Web client authentication.
_METAPERSON Specifies the Person metadata name that is associated with the _METAUSER login variable. The value of this variable can be UNKNOWN. This variable cannot be modified by the client.
_METAUSER Specifies the login username that is used to connect to the metadata server. This variable cannot be modified by the client.
There is no easy answer to your question, because it depends on your set up. Do your users have to login by using Metaserver? Is your code always accessed using the WebService? User IDs, what are they, are they ID from AD? Is Single-Sign-On (SSO) enabled? How are the IDs configured on SAS? Do people use Trusted Users to connect?
Regards, Vasilij
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With