SAS supports a number of ISO formats for datetimes that are common to transaction logs, web logs, XML, and JSON, and other interchanges.
Here's an example from the documentation (linked above):
data _null_;
input dtB :b8601dt15. dtE :e8601dt19.;
put dtB=b8601dt. dtE=e8601dt.;
datalines;
20120402T124022 2012-04-02T12:30:22
;
run;
Output:
dtB=20120402T124022 dtE=2012-04-02T12:30:22
Usually one of those formats will suit, as you're trying to conform to another standard.
However, you discovered that you can create your own custom datatime format like this:
proc format;
picture BI_DTIME_FMT
other = '%Y%0m%0d %0H:%0M:%0S' (datatype=datetime);
run;
data _null_;
/*sampdtime=1551022320;*/
sampdtime='23FEB2009:15:32:00'dt;
put sampdtime= BI_DTIME_FMT.;
run;
To make that format "permanent", place it in a libname that is found in your OPTIONS FMTSEARCH path.
... View more