I want to load data by using macro but last day is different from month
for example, in feb last day is 31 but in april 30
how can i do..?
%macro dataload(year=17,month=11);
proc import out = temp;
%if &month=1 or &month=3 or &month=5 or &month=7 or &month=8 or &month=10 or &month=12 %then
datafile = "J:\&year..&month.\&20&year.&month.01-20%year.%month.31.xlsx"
%else &month= 4 or &month= 6 or &month= 9 or &month= 11 %then
datafile = "J:\&year..&month.\&20&year.&month.01-20%year.%month.30.xlsx"
%else &month=2 and &year=16 %then
datafile = "J:\&year..&month.\&20&year.&month.01-20%year.%month.29.xlsx"
%else &month=2 %then
datafile = "J:\&year..&month.\&20&year.&month.01-20%year.%month.28.xlsx"
DBMS = XLSX replace;
sheet = "sheet1";
run;
%mend
%dataload(year=17,month=11);
%dataload(year=17,month=10);
%dataload(year=17,month=09);