Hi, I have followed your advice...do you mean something like this? I have tried and it seems work. Thank for your help! data _null_;
if exist("&ds2_in.") then do;
dt_rep_1 = put("31OCT2018"d, date9.);
dt_rep_2 = put(intnx("month","31OCT2018"d,-1,"e"), date9.);
end;
else if exist("&ds1_in.") then do;
dt_rep_1 = put(intnx("month","31OCT2018"d,-1,"e"), date9.);
dt_rep_2 = put(intnx("month","31OCT2018"d,-2,"e"), date9.);
end;
call symputx("date1",dt_rep_1,"g");
call symputx("date2",dt_rep_2,"g");
run;
... View more