You can use either the string date or the number date. The trick is turning the string date into a number date 🙂 data work.have;
label id = "ID";
informat Rawdate date9.;
format Rawdate NowNumberdate yymmd7.;
length StringDate $7;
input id Rawdate StringDate $;
NowNumberdate = input( compress(stringdate,,'kd') , yymmn6. );
datalines;
5134223 1OCT2018 2018-10
;
run;
data work.want;
set work.have;
output;
do until ( coalesce(NowNumberdate,"1dec2018"d) ge "1dec2018"d);
NowNumberdate = intnx('month', NowNumberdate,1);
output;
end;
run;
... View more