how to populate date like this
DAT from this format to this format
31DEC2019 31 DEC 2019
01MAR2020 01 MAR 2020
08MAR2020 08 MAR 2020
1JUN2020 01 JUN 2020
With space
Thanks in Advance
Try this
data have;
input date :date9.;
format date date9.;
datalines;
31DEC2019
01MAR2020
08MAR2020
01JUN2020
;
proc format;
picture dtfmt (default=12)
low - high = '%D %3b %Y' (datatype=date)
;
run;
data want;
set have;
format date dtfmt.;
run;
Supposing your data is a SAS date and not a string, your best bet is probably to create a picture format to display the date as you request.
Try this
data have;
input date :date9.;
format date date9.;
datalines;
31DEC2019
01MAR2020
08MAR2020
01JUN2020
;
proc format;
picture dtfmt (default=12)
low - high = '%D %3b %Y' (datatype=date)
;
run;
data want;
set have;
format date dtfmt.;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.