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?

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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