I'm using SAS to connect to an Oracle database, and running into trouble with the dates. When using pass-through queries, is there a PL/SQL alternative to "DATEPART()" that will save dates as a SAS Date, rather than a SAS Timestamp? I'd prefer to avoid using LIBNAME or SAS's SQL converter, and would like to do this without an extra SAS data step.
I've experimented with DBSASTYPE= , but it doesn't seem applicable to passthrough SQL.
Example -- "SYS_DATE" from this query is stored as a SAS Timestamp rather than a SAS Date.
Proc SQL;
Create Table WORK.DATE_ORACLE as
Select * From Connection to ORACLE
(
SELECT trunc(SYSDATE) as SYS_DATE FROM DUAL
);
quit ;
cast(SYSDATE as date) as SYS_DATE
work? (It works for SQL server, I don't have Oracle to test against). – david25272