BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am trying to append my SAS dataset into an Oracle table, but the Oracle does not recoginze SAS date - After uploading, all date columns in my SAS dateset show up in Oracle as 1960, 1961... How do convert/specify my SAS date columns so that Oracle can recognize them?

Thanks!
3 REPLIES 3
darrylovia
Quartz | Level 8
I pull data from Oracle and push to Oracle almost on a daily basis.

Generally Oracle treats dates as datetime values in SAS speak. Download an Oracle table and you'll see all date fields with a datetime. format and informat associated with it.

I would first convert your date in the SAS data set into a SAS date time value then run your append. See the below function.

newDate=dhms(Yourdate,0,0,0);

that should work..

D
deleted_user
Not applicable
Many many thanks D! I imagined that this would be a common issue, but to my surprise I couldn't find information over Internet. It worked. Thanks again!
deleted_user
Not applicable
One more question D,

I was able to upload date column into oracle table, but when I check the values I found seemingly random time values (the date is correct), even though I used MY_DATE = dhms(MY_DATE, 0, 0, 0). Does this sound right?

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1166 views
  • 0 likes
  • 2 in conversation