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.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 6397 views
  • 4 likes
  • 5 in conversation