Hi ,
I am looking for auto date fetching;
e.g start date='05feb2018'd
i want to fetch auto date for every next month i.e. 5th day of every month should be the start date.
.eg. for next month when the program is auto run it should fetch the start date as 5th day of next month.
Similarly end date should be last day of every current month.
e.g end_date='28thfeb2018'd for feb ...for march it should fetch the last date e.g. end_date='31March2018'.
Also let me know how can we code it in EG using the query builder.
Thanks
intnx gives you all the flexibility. You should really look into it.
data want;
format startDate endDate yymmdd10.;
startDate = intnx("day",intnx("month", today(),1),4);
endDate = intnx("month", today(),0,"end");
run;
proc print data=want; run;
Use the date interval function intnx:
data want;
format startDate endDate yymmdd10.;
startDate = intnx("day",intnx("month", today(),0),4);
endDate = intnx("month", today(),0,"end");
run;
proc print data=want; run;
intnx gives you all the flexibility. You should really look into it.
data want;
format startDate endDate yymmdd10.;
startDate = intnx("day",intnx("month", today(),1),4);
endDate = intnx("month", today(),0,"end");
run;
proc print data=want; run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.