06-17-2013 12:27 PM
The automatic macro variable "_CLIENTUSERNAME"
Extracts user name of the user/client but does not work in base SAS.
Is there an equivalent automatic macro variable in Base SAS that extracts the user name?
Thanks for you attention.
12-04-2014 05:10 AM
Its really dependant on your setup. If you have SAS locally installed then sysuserid will return the username it gets, probably Windows user login (I can't test this). If you have it on a virtual system then it may be the login information for the virtual system. We have ours on Citrix and that return the user information which is setup in the initiation files.
Depending on your setup and what you want to do, you would need to talk to your IT Helpdesk. Principally, you need to be careful what you are doing with the information, but also your IT will be the ones who deal with login information.
If its just a matter of you want in your program and audit of who ran a program, then just setup a small dataset somewhere with user list and take it from there based on the sysuserid.
12-04-2014 04:55 AM
If you run (in SASBase):
you get a list of available macro variables.
If you run x set;
you will be sent to a dos-box showing the environment variables.
You could apply the mechanism below to any of the environment variables:
%put username is: &username;
%put domain name is: &domainname;