Sometimes the numeric formats provided by SAS are not enough to deal with the datetime values. Let say we we have a date time format in the form of dd-mm-yyyy hh:mm:ss, then there is no standard format to deal with this.
Below code can help you to create your own custom date time format in SAS.
proc format; picture MyMSdt other='%0d-%0m-%0Y %0H:%0M:%0S' (datatype=datetime); run; data test; mydatetime='25nov2009 14:44:56'dt; format newdt MyMSdt.; newdt=mydatetime; put mydatetime= newdt=; run;
The LOG shows: mydatetime=1574779496 newdt=25-11-2009 14:44:56
No comments:
Post a Comment