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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: