Hi All,
We have clamno and other fields in the report. If we are running a program today, it has to get only previous adjudicated date not other date.
For example, if a program runs Monday it has to get the Friday’s data and for Tuesday it has to get Monday’s data vice versa...Do you have any macro code to get only previous day (date format mm/dd/yyyy).
clamno | Adjdate |
12345 | 03/08/2013 |
56789 | 03/08/2013 |
90876 | 03/29/2013 |
Output needs to be:
clamno | Adjdate |
12345 | 03/08/2013 |
56789 | 03/08/2013 |
Can you please provide me the sample macro code to get only previous day?
Thanks in Advance
%let current_date=%sysfunc(date(), date9.);
%put ¤t_date;
%let prev_date=%sysfunc(intnx(weekday, "¤t_date"d, -1), date9.);
%put &prev_date.;
data want;
set have;
where adjdate="&prev_date"d;
run;
an example:
data have;
input clamno adjdate mmddyy10.;
cards;
12345 03/08/2013
56789 03/08/2013
90876 03/29/2013
;
data want;
set have;
if weekday(today())=2 then adate=today()-3;
else adate=today()-1;
if adjdate=adate;
format adjdate mmddyy10.;
drop adate;
proc print;run;
Obs clamno adjdate
1 12345 03/08/2013
2 56789 03/08/2013
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.