Architecting, installing and maintaining your SAS environment

Oracle Date Column import into SAS as DATETIME20.

Reply
Frequent Contributor
Posts: 90

Oracle Date Column import into SAS as DATETIME20.

Hi All,

 

I have difined oracle DB in SAS SMC and register the tables too.

 

The table has birth_dt column as DATE Format(data like 20APR1990) when i see the same column in SAS SMC and EG, been converted as DATETIME20.0(data shows like 20APR1990:00:00:00).

 

Users dont want apply any code on SAS dataset to extract date like datepart functions.

 

how to restrict 'birth_dt' column to register in SAS Metadata as in Oracle DB(DATE9. format) and stop converting to DATETIME20. format?

 

 

 

Thank you,

CG

Super User
Posts: 3,306

Re: Oracle Date Column import into SAS as DATETIME20.

What you are seeing is the default translation of Oracle data types to SAS ones as documented here:

 

http://support.sas.com/documentation/cdl/en/acreldb/69580/HTML/default/viewer.htm#p06jk0u30uhuj5n18f...

 

The Oracle data type DATE, also includes times.

 

Try the SASDATEFMT option for overriding the default translation:

 

data test;
  set OraLib.OraTable (sasdatefmt = (dates = 'date9.'));
run;

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 134 views
  • 0 likes
  • 2 in conversation