Reaching out to understand what's happening...
I'm storing some dates in some macro variables -
data _null_;
call symput('month_tag',put(intnx('month',today(),-0),monname3.));
call symput('year',put(intnx('year',today(),0),year.));
run;
%put &month_tag &year;
We can then use this sample data set -
data sample;
input test_a test_b test_c;
cards;
173 181 172
;
run;
The data set represents a final step in the process after many summaries have been done. We want to display these summaries with the time period. If I pass the macro-variables holding the dates to the newly created invoice variable, we don't quite get what we want -
data out;
set sample;
invoice = &month_tag._&year;
run;
If you can run this output, you will see that for some reason SAS is creating the variable invoice as it should, but instead of using the macro-variable value, its taking that value and producing another variable with the value as the new variable's name.
I got around it with -
data out2;
set sample;
invoice = "&month_tag._&year";
run;
My instinct tells me it has something to do with the way I am using/printing the &month_tag._&year within the invoice variable, but if anyone could clear this up for me I would appreciate it.
