User:LainieH/test page

From sasCommunity
Jump to: navigation, search

sasCommunity Tip of the Day

Did you know that on Unix (also in Windows since 'set' command is also valid) platforms, you can automatically assign all Unix environment variables to SAS macro variables by adding these lines of code to your appserver_autoexec.sas:

 
/* Make macro variables from all environment variables */
filename set_list pipe "set";
data work.envvars;
   length name $255;
   length value $32512;
   infile set_list DLM='=' MISSOVER lrecl=32767;
   input name $ value $;
   if name ^= "'" then do;
                call symputx(name,value);
   end;
run;

This is very useful in situations where you need to allow your business clients to set their own default macro variables; while at the same time limiting the number of people who can modify anything under your !SASROOT. Variable length shown above can be made smaller as needed.

More about file pipes

More about SYMPUT

Submitted by Darrel Cusey. Contact me at my Discussion Page.


Feel free to comment on this tip.




Check out the Tip of the Day page for details about this effort.



View the web-site usage statistics and the definition of terms used in that report.