Hi @Mscarboncopy , maybe you already figured out the answer base on others' reply, but here is my version of code (mainly base on @Tom 's reply), and I think these are effective and efficient solution according to your request.
data dtfmt1;
input ID DATE datetime16.;
datedt16=date;
format datedt16 datetime16.;
datalines;
1 27JUL25:09:00:00
2 05AUG25:10:00:00
3 15AUG25:08:00:00
4 20AUG25:11:30:00
;
run;
proc print data=dtfmt;run;
data dtfmt2(drop=date datedt16);
set dtfmt1;
dated=datepart(date);
time=timepart(date);
day_of_week=weekday(dated);
month=month(dated);
day=day(dated);
year=year(dated);
format dated date9.
time timeampm8.
day_of_week downame.
month monname.;
run;
proc print data=dtfmt2;run;
proc format;
picture mydt(default=40)
low-high='%F,%c %d,%Y %H:%0M %p'
(datatype=datetime);
run;
data dtfmt3;
set dtfmt1;
format date mydt.;
datechar=put(date,mydt.);
run;
proc print data=dtfmt3;run;
And @Mscarboncopy , several techniques perhaps you would like to know: 1)if one wants to display a month's number in character month name, monname. format works, similarly, weekday() function returns a number, if one want to display the character weekday, downame. format works (and you do not need to use proc format 1='Monday' etc.), and I just learnt it from @Tom 's reply, 2) use timeampm8. format to reduce the 00:00:00 time format to 00:00, 3)if one would like to display date/time in a specific format, use picture format (and I copied this from @Tom 's reply), and if one would like to further convert it to character string, put(date/time, picfmt.) is the efficient way, and catx() is not a good way to do it because nested functions such as catx(catx()) is a bit too complicated and cost a lot of eyesight.
... View more