How can I get the value of my environment variables into my SAS session, and can I modify these settings?


You can use the SYSGET function of SAS to get the value of your environment variable into your SAS job. For example, to query the value of your HOME environment variable, you can do the following:

data getenv;
homedir=sysget('HOME');
put homedir=;
run; 

To change the value of an environment variable, you can use the C-shell SETENV command and SAS will reset the value of the environment variable in the current SAS session. For example, to update the environment variable STATUS you can do the following:

x "setenv STATUS 'running dstep doit'";
data doit;
<some more datastep code>  run;