Hi,
I am having an input '05AUG2019:09:00:00.000000' which is to be formatted to
2019-08-05:09:00:00.000000
i am using below code to achieve this but it returns me "ERROR" in the column.
proc format ;
picture mdyhms other = '%Y-%0m-%0d %0H:%0M:%0S.000000' (datatype=datetime);
Read with the DATETIME informat, and assign your display format:
proc format ;
picture mdyhms other = '%Y-%0m-%0d %0H:%0M:%0S.000000' (datatype=datetime);
run;
data test;
invar = '05AUG2019:09:00:00.000000';
outvar = input(invar,datetime25.);
format outvar mdyhms.;
run;
So wait a minute here
@laxmanpai wrote:
I am having an input '05AUG2019:09:00:00.000000'
You have a character string that looks like 05AUG2019:09:00:00.00000? You can't format a character string that way. You'd have to convert it to numeric first. Then you should be able to use the E8601DTw.d format
But before I come up with code to do this, please confirm that you mean you really do have a character string.
Hi,
The input is coming from Oracle Timestamp(6) column and i am reading it from SAS EG.
The Actual data is in format 3/19/2018 12:53:09.000000 PM
i want the data to be displayed as 2018-03-19 12:53:09.000000
If i dont use any format function it is being read as "Timestamp Not Recognized" while trying to load into Snowflake .
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.