Help using Base SAS procedures

Oracle not recognizing SAS date

Reply
N/A
Posts: 0

Oracle not recognizing SAS date

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!
Frequent Contributor
Posts: 139

Re: Oracle not recognizing SAS date

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
N/A
Posts: 0

Re: Oracle not recognizing SAS date

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!
N/A
Posts: 0

Re: Oracle not recognizing SAS date

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?
Ask a Question
Discussion stats
  • 3 replies
  • 266 views
  • 0 likes
  • 2 in conversation