Change format from DATEAMPMw. to DATETIMEw. where w is length of output dislaying date and time.
If time is 13:42 there is no need to add PM.
When you use function TIMEPART you have time only, without the date.
format DATETIME is to be used with your variable Open_Date.
Use format time5. or time7. for TIME (as timepart).
Data table1;
Set table1;
Time =timepart (open _date);
Format open_date datetime.
time time7.;
Run;
Look at next link - formats by categories:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001263753.htm
You compute
Time =timepart (open_date);
which gives you a date of 01jan60 - this turns a red light, maybe your variable Open_Date is not a datetime but a time only.
In sas 0 (zero) is equal to Jan 1st 1960.
Try do:
Data _NULL_;
set have;
put open_date time9.;
run;
and check the log.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.