Tip of the Day

From sasCommunity
Jump to: navigation, search

sasCommunity Tip of the Day

Did you know that on Unix 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);

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.

Prior tip - Next tip -- Random Tip

Submit a Tip


Tips Index by Status

Currently in Use | Yet to be Scheduled | Still Under Review | Tip Awaiting Refinement

Search Tips:

The Tip of the Day Project

A new technical Tip of the Day related to SAS software will be shown on this page and the sasCommunity.org main page every day. Before getting started, you can Browse and Search the current list of tips contributed by users.

Anyone can participate. We hope you do! Here's how:

  1. Submit a Tip by posting a SAS tip that you think others might find useful
  2. Review a Tip prior to publishing
This effort is similar to, and was motivated by, the WikiPedia Tip of the Day Project. Please tell us what you think