Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to catch the NT envirentment variable 1

Status
Not open for further replies.

6656

Programmer
Nov 5, 2002
104
US
Hi all,

Do you know that how to catch an envirentment variable on MS-Windows since SYSGET() doesn't wok for Windows?

Thanks,
Mike
 
Mike,
Could you tell me which Windows variable are you looking for? If its the user id you could use the &sysuser macro var.
klaz
 
Mike,

Try to use a pipe filename statement with the dos 'SET' command. You will return info about system variables to a data step and then can parse out the ones you want :

filename env pipe 'set';

data _null_;
infile env;
length vars $ 500;
infile env lrecl=2000;
input vars &;
varname = scan(vars,1,'=');
value = scan(vars,2,'=');
put vars varname value;
run;

Fred
 
THANKS YOU ALL,

FRED'S CODE WORKS FINE FOR THE USER'S CUSTOMIZED ENV VARIABLE.

MIKE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top