This post was kindly contributed by Ken's SAS tricks - go there to comment and to read the full post. |
The call symput(“macroname”, varname) is really useful for getting data from a data set into SAS code that’s executed later. One example is shown here.
This entry is inspired by a simulation project I’m coding right now where there are many parameter settings that apply to all cases. The data will be about a million lines long, and there are 13 parameters, some of which require functional operations before the simulations starts. In my initial draft of the simulation, I had all of this in the data step with the simulation, but this is really inefficient and and comsumes a lot of space. Instead, I broke the parameter settings into a separate data step and made them macro variables with call symput. But it would be smart to check them.
The simple way to do this is with the macro %put statement. This prints the value of text or of named macro variables to the log. You can also use
%put _global;
to display all of the current global macro variables.
This post was kindly contributed by Ken's SAS tricks - go there to comment and to read the full post. |