Hi guys Goodmorning,
in this data set i want including last date like below
2016-02-29
2017-05-31
2018-06-30
2019-02-28
data dsn;
input date yymmdd10.;
format date yymmdd10.;
datalines;
201602
201705
201806
201902
;
run;
Ok. Do like this then
data dsn;
input date;
format date;
datalines;
201602
201705
201806
201902
;
run;
data want;
set dsn;
date=intnx('month', input(put(date, 6.), yymmn6.), 0, 'e');
format date yymmdd10.;
run;
Assuming your data is sorted.. Also, I corrected your test data
data dsn;
input date :yymmdd10.;
format date yymmdd10.;
datalines;
2016-02-29
2017-05-31
2018-06-30
2019-02-28
;
run;
data want;
set dsn end=lr;
if lr;
run;
Hi Draycut
keep it datalines as it is
201602
201705
201806
201902
but i want output like below
2016-02-29
2017-05-31
2018-06-30
2019-02-28
Sorry, but
data dsn;
input date yymmdd10.;
format date yymmdd10.;
datalines;
201602
201705
201806
201902
;
run;
is not working at all, please fix it. As soon as you have a sas-date, you can use intnx to move it to end of the month by using
date = intnx('month', date, 0, 'E');
Ok. Do like this then
data dsn;
input date;
format date;
datalines;
201602
201705
201806
201902
;
run;
data want;
set dsn;
date=intnx('month', input(put(date, 6.), yymmn6.), 0, 'e');
format date yymmdd10.;
run;
Thank you very much
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.