- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 11-06-2009 02:48 AM
(3735 views)
Hi,
I have a requirement where i need to insert todays date from a dataset variable into the oracle table column(Date type). For inserting todays date into the sas dataset column, i am using today() function.
Consider a example:
data SAS.DATA_DATE;
load_date=today();
format load_date mmddyy10.;
run;
consider a table is already present in the oracle having a column load_date (DATE type).
Now i am inserting todays date using the following:
proc sql;
insert into Oracle.DATE (load_date) select (load_date) from SAS.DATA_DATE;
quit;
This is running fine but the load_date in oracle table is showing 1/1/1960 instead to todays date. Please help.
I have a requirement where i need to insert todays date from a dataset variable into the oracle table column(Date type). For inserting todays date into the sas dataset column, i am using today() function.
Consider a example:
data SAS.DATA_DATE;
load_date=today();
format load_date mmddyy10.;
run;
consider a table is already present in the oracle having a column load_date (DATE type).
Now i am inserting todays date using the following:
proc sql;
insert into Oracle.DATE (load_date) select (load_date) from SAS.DATA_DATE;
quit;
This is running fine but the load_date in oracle table is showing 1/1/1960 instead to todays date. Please help.
5 REPLIES 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Search the SAS support http://support.sas.com/ website - here is a Google advanced search argument to use:
date oracle table site:sas.com
You want to check the validity of your SAS variable containing the date - a value of 1/1/1960 indicates a SAS numeric internal value of zero rather than the current date which is the number of days since 1/1/1960.
Scott Barry
SBBWorks, Inc.
Working with Dates in the SAS System
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm
date oracle table site:sas.com
You want to check the validity of your SAS variable containing the date - a value of 1/1/1960 indicates a SAS numeric internal value of zero rather than the current date which is the number of days since 1/1/1960.
Scott Barry
SBBWorks, Inc.
Working with Dates in the SAS System
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001304321.htm
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This may apply to your problem:
http://support.sas.com/documentation/cdl/en/acreldb/61890/HTML/default/a001371624.htm
/Linus
http://support.sas.com/documentation/cdl/en/acreldb/61890/HTML/default/a001371624.htm
/Linus
Data never sleeps
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Scott and Linus. It worked.
You are great!!
You are great!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
For the benefit of others, specifically, what was it that "worked" to solve your condition?
Scott Barry
SBBWorks, Inc.
Scott Barry
SBBWorks, Inc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
SASDATEFMT=(DBMS-date-col-1='SAS-date-format'
<... DBMS-date-col-n='SAS-date-format'>)
It is used if the SAS column date format does not match the date format of the corresponding DBMS column, convert the SAS date values to the appropriate DBMS date values
This option helped me getting the data in correct format in oracle table.
More examples of its usage are mentioned at http://support.sas.com/documentation/cdl/en/acreldb/61890/HTML/default/a001371624.htm.
Please let me know in need more clarification.
<... DBMS-date-col-n='SAS-date-format'>)
It is used if the SAS column date format does not match the date format of the corresponding DBMS column, convert the SAS date values to the appropriate DBMS date values
This option helped me getting the data in correct format in oracle table.
More examples of its usage are mentioned at http://support.sas.com/documentation/cdl/en/acreldb/61890/HTML/default/a001371624.htm.
Please let me know in need more clarification.