<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Appending to oracle. in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/372844#M11305</link>
    <description>Datetime with SASDATEFMT did the work. Thanks.</description>
    <pubDate>Mon, 03 Jul 2017 20:10:43 GMT</pubDate>
    <dc:creator>Thylacine</dc:creator>
    <dc:date>2017-07-03T20:10:43Z</dc:date>
    <item>
      <title>Appending to oracle.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371430#M11247</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I encountered a problem. I have a data set in work lib with a column that needs to be current date. When i try to proc append the dataset to an existing oracle table it works for every other column exept for the one with date(column is empty). &amp;nbsp;Column in oracle is data type and is holding sysdate(the oracle one) format data. I tried in many ways like datetime(),'put'ing with different formats, creating custom format in sas that is a copy of oracle sysdate mm/dd/yyyy hh:mm:ss am/pm (%p in picture) but can't get the row to append. Any suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 19:02:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371430#M11247</guid>
      <dc:creator>Thylacine</dc:creator>
      <dc:date>2017-06-28T19:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Appending to oracle.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371434#M11248</link>
      <description>&lt;P&gt;try using SASDATEFMT. We use SASDATEFMT extensively while doing appends&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please check the link below for the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371624.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001371624.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 19:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371434#M11248</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2017-06-28T19:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Appending to oracle.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371468#M11251</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148759"&gt;@Thylacine&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;SAS doesn't have a data type of DATE but SAS dates are stored in a variable of data type numeric. The only way for the SAS Access engine to detect that such a numeric SAS variable needs a date conversion when loading into Oracle is via a SAS date or datetime format applied (or via explicit instruction via SASDATEFMT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've made the experience that the SAS/Access engines doesn't recognize all SAS date and datetime formats and though can treat SAS date/datetime values like any other numerical values when loading into Oracle. For this reason I tend to use formats DATE9. and DATETIME21. for all my SAS variables with date/datetime values as with these formats implicit conversion always worked for me and never caused me any problems.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 21:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371468#M11251</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-06-28T21:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Appending to oracle.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371575#M11254</link>
      <description>&lt;P&gt;Well i tried both and failed. In latest version column is created by put(datetime(),datetime21.2) as inserted_at (tried 21. too), and append looks like&amp;nbsp;proc append base=oracletable(sasdatefmt=(inserted_at='datetime21.2')) data=dataset force ; run; Doing something wrong or any more suggestions? Oracle column is in windows format&amp;nbsp;h:mm:ss AMPM.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 08:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371575#M11254</guid>
      <dc:creator>Thylacine</dc:creator>
      <dc:date>2017-06-29T08:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Appending to oracle.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371599#M11255</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/148759"&gt;@Thylacine&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If your target column in Oracle is of type DATE then your SAS column must be of type NUMERIC with a format of DATE or DATETIME applied.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't confuse the format of a variable with its datatype!&lt;/P&gt;
&lt;P&gt;A put(datetime(),datetime21.2) creates a character string and you would use this to load into an Oracle CHAR or VARCHAR column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following code should work once you've replaced the &amp;lt;libref&amp;gt;.&amp;lt;tablename&amp;gt; with our real Oracle table name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data source;
   format inserted_at datetime21.;
   /* map all the columns from target */
   if 0 then set ora.oracletable;
   inserted_at=datetime();
run;

proc append base=ora.oracletable data=work.source force ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 10:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/371599#M11255</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-06-29T10:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Appending to oracle.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/372844#M11305</link>
      <description>Datetime with SASDATEFMT did the work. Thanks.</description>
      <pubDate>Mon, 03 Jul 2017 20:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Appending-to-oracle/m-p/372844#M11305</guid>
      <dc:creator>Thylacine</dc:creator>
      <dc:date>2017-07-03T20:10:43Z</dc:date>
    </item>
  </channel>
</rss>

