Macro variables resolve to text, i.e. SAS code.
If you submit:
%put &=EndPeriod;
%put &=Ext;
it will print the resolved values of those two variables to the log. What do you see in the log when you run that?
Let's suppose that you have macro variables like:
6 %let EndPeriod="27Dec2017"d;
7 %let Ext=Production;
8
9 %put &=EndPeriod;
ENDPERIOD="27Dec2017"d
10 %put &=Ext;
EXT=Production
Then when the macro variables resolve, your SQL code would be like:
proc sql;
create table out.Represent_ACH_groupedProduction as
select
"27Dec2017"d as PRD_END_DT
,'ACH' as Channel
,represent_group
,count(*) as items
from out.Represent_data_ACH_V3Production
group by 3
;
quit;
That is valid PROC SQL code (or at least looks like it, I didn't run it). On the select statement you can put literal values in addition to column names. So 'ACH' as Channel puts the character string ACH into the column Channel. "27Dec2017"d as PRD_END_DT puts the numeric value 21180 (which is the SAS date for Dec 27, 2017) into the column PRD_END_DT.
... View more