Any one have any ready made macro to get different days of the month into Date9. format.
first day of the month,
first day of the last week
Last day of the last week
last saturday of last week
First day of the current week etc.. some thing similar
data _null_; yday=put(date()-1,date9.); today=put(date(),date9.); lsat=put(date()-1,date9.);*take last Saturday; to = put(date(),worddate18.); mthy= put(date(),monyy7.); %let fdlw=%sysfunc(intnx(week,%sysfunc(today()),-1,b),date9.); %put first_day=&fdlw ; %let last_sat=%sysfunc(intnx(week.7,%sysfunc(today()),0,b),date9.); %put last_sat=&last_sat ; %let ldlw=%sysfunc(intnx(week.7,%sysfunc(today()),0,b),date9.);*Last Saturday; %put ldlw=&ldlw ; %let fdcm_=put(date()-15,date9.);
call symput('rptdt',to); call symput('rptnumdt',today); *05FEB2021; call symput('ydt',yday);*05FEB2021; call symput('fdcm',fdcm_ ); call symput('my',mthy);*FEB2021; run;
%let ydate= &ydt.; * yesterday's date ; %let Mydate= &my.; * yesterday's date ; %let From_date= &ydt. ; %let To_date=&rptnumdt.; %let FirstDay_CurMon=&fdcm.; %put _all_;
... View more