08-12-2016 06:44 AM
I want to identify the mail ID from windows username in SAS. In .NET I have the code for same as below:-
But I am not able to find any solution in SAS. Please help!
08-12-2016 06:58 AM
I'd suggest to write a little .NET program that makes that method/function call and writes the result to standard output.
Then call that program from SAS with
filename oscmd pipe "your_net_program"; data _null_; infile oscmd; input; call symput('current_email',_infile_); run;
08-12-2016 08:08 AM
Assuming you have priviledge to access Active Directory properties then DSGET/DSQUERY:
However I would point out that SAS is built to do analysis and processing of data, not for doing administrative tasks on your operating systems, so it sounds like your doing something wrong. I presume if you are after email then your sending something to someone? If so then there are far better methods out there - shared network area, sharepoint, report publishing platforms etc. Sending things via email can be unsecure, and there are limits on what you can send.