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.
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.