Hello everyone,
I want to export SAS data to Hive.
Tpye timestamp in hive is "yyyy-mm-dd hh:mm:ss.sss",but when I used format E8601DTw.d in SAS,it appeared as
"yyyy-mm-ddT hh:mm:ss.sss",how can I deal with it without "T",or do you have other better solutions?
I really appreciate for your help.
It sounds like you are using a STRING column in Hive.
If you are on .12 or higher, this is not the recommended approach.
Use a TIMESTAMP data type instead, and SAS/ACCESS should be able to map it, thus no need to specify a SAS ISO datetime format.
"Highlighting New Hive .12 Data Types
Hi @zdk
Maybe you could try to use a picture format:
proc format;
picture myfmt (default = 50) low-high='%Y-%0m-%0d %0H:%0M:%0S' (datatype=datetime);
run;
Hi,
Maybe your own format:
proc format;
picture myTimestamp (default=19)
other='%Y-%0m-%0d %0H:%0M:%0S' (datatype=datetime);
run;
data test;
a = datetime();
format a myTimestamp.;
run;
proc print;
run;
All the best
Bart
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.