BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Patrick
Opal | Level 21

It's imho a flaw that the SAS/Access to Oracle engine doesn't recognize all the OOTB SAS Date and DateTime formats but if you use Date. and Datetime. then things will just work implicitely without any extra options.

 

I've just run below code which loads a SAS Date and DateTime value into Oracle (creating a new table in Oracle) and things just work.

data work.SAS_table;
  format SAS_Date_var date9. SAS_DateTime_var datetime21.;
  SAS_Date_var=today();
  SAS_DateTime_var=datetime();
run;

proc append data=work.SAS_table base=ora.Oracle_Table;
run;quit;

That's how the Oracle table then looks like from the SAS side:

Capture.PNG

 

And here from the Oracle side via SQL Developer

Capture.PNG

Capture.PNG

 

Patrick
Opal | Level 21

Assign a format of DATE9. to the SAS variable. I believe if that's done then the SAS/Access to Oracle engine gets it and converts your SAS date value correctly to a Oracle DATE value.

 

sas-innovate-2024.png

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.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 16 replies
  • 3664 views
  • 4 likes
  • 5 in conversation