I'm trying to covert a character variable, timestamp, to a datetime variable that will merge with another datetime variable, date_created, in the format datetime22.3 Timestamp is currently in this format: And I would like it to match date_created, which looks like this (datetime22.3): I tried input, but received the error "invalid argument to function input". data want;
informal time datetime22.3;
set have;
time=input(timestamp, datetime22.3);
format time datetime22.3;
run; Putting ?? before the format in the input statement got rid of the error and applied the format according to proc contents, but it produces no output. data want;
informal time datetime22.3;
set have;
time=input(timestamp, ?? datetime22.3);
format time datetime22.3;
run; The output looks like this, where the first column is the variable timestamp, and the second column is the variable time. I appreciate any advice!
... View more