Hi everyone,
i need to create table on post 14th weekday fo the month, i have macro which store current month and year. for eg. lets say rpprd=201512, so my requirement is create table only after 14th weekday of the current month. so for this month it will be after 18th-Dec-2015 i can create table. so the check is only on the current date, which should not not between 1st to 14th weekday of the current month in order to create table.
so something like below i want.
%if (%sysfunc(today() = 1st to 14th weekday of the current month)) then do;
%put "can't create table as per rule" ;
%end;
%else; %do;
proc sql;
create table xyz;
quit;
%end;
Thanks in advance,
Regards,
Tushar J
Did you check INTNX() + weekday ?
%let year=2015;
%let month=12;
%let want=%sysfunc(intnx(weekday,%sysfunc(mdy(&month,1,&year)),14),date11.);
%put &want ;
Did you check INTNX() + weekday ?
%let year=2015;
%let month=12;
%let want=%sysfunc(intnx(weekday,%sysfunc(mdy(&month,1,&year)),14),date11.);
%put &want ;
HI Ksharp,
thanks for your reply, however i am getting error after executing below code on EG SAS 9.1.3.
%let year=2015;
%let month=12;
%let want=%sysfunc(intnx(weekday,%sysfunc(mdy(&month,1,&year)),14),date11.);
%put &want ;
ERROR: Format name DATE11. not found or the width and/or decimal specified for the format used are out of range.
However changing format from date11. to date9. gave me correct date. Thanks for your reply and your logic Ksharp.
Regards,
Tushar J.
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.