solved
You have not supplied a sample data nor expected results.
You can remove first step and try next code:
proc sql;
create table reportsummary as
select reportName,
count(key_num_acct) as reports_vol
from permdata.reportreferrals
where reportDT = today() - 2.
group by reportName;
quit;
You have not supplied a sample data nor expected results.
You can remove first step and try next code:
proc sql;
create table reportsummary as
select reportName,
count(key_num_acct) as reports_vol
from permdata.reportreferrals
where reportDT = today() - 2.
group by reportName;
quit;
Macro variables SHOULD NOT be formatted.
data _null_;
call symput('today',intnx('day',today(),-2));
run;
But @Shmuel has a simpler approach.
Why would you want to compare REPORTDT to a number that is less than 1 thousandths?
625 data test; 626 x=31/07/2020 ; 627 put x=; 628 run; x=0.0021923621
Isn't REPORTDT a DATE variable? Wouldn't you want to compare it to another date value? The date value for 31JUL2020 is 22127.
Either set the macro variable to the number of days.
call symputX('today',today()-2);
Or set it to a string that the DATE informat can recognize and use it make a date literal in your later code.
call symputX('today',put(today()-2,date9.));
...
where reportDT = "&today"d
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.