<?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: How to insert dates with proc sql insert into? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325458#M62245</link>
    <description>&lt;P&gt;Please don't be a lazy programmer and name &lt;STRONG&gt;datetime&lt;/STRONG&gt; values as &lt;STRONG&gt;dates&lt;/STRONG&gt;. When crossing the boundary to SAS the values are quite different and functions/actions that will work on DATES will either fail or create very unexpected results when used with DATETIMES (and vice versa).&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2017 20:36:03 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-01-17T20:36:03Z</dc:date>
    <item>
      <title>How to insert dates with proc sql insert into?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325350#M62226</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to manually create some rows in a table, with the insert to statement, coded looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;insert into lib.table values(&lt;BR /&gt;'OPEN',&lt;BR /&gt;10001,&lt;BR /&gt;10041,&lt;BR /&gt;10004,&lt;BR /&gt;'13',&lt;BR /&gt;'ACT');&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, how do I insert a date such as (01JAN2017) so that it is a valid SAS date?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 17:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325350#M62226</guid>
      <dc:creator>Datino</dc:creator>
      <dc:date>2017-01-17T17:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert dates with proc sql insert into?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325373#M62229</link>
      <description>&lt;P&gt;Try next code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;insert into lib.table values(&lt;BR /&gt;'OPEN',&lt;BR /&gt;10001,&lt;BR /&gt;10041,&lt;BR /&gt;10004,&lt;BR /&gt;'13',&lt;BR /&gt;'ACT&lt;STRONG&gt;',&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;'01jan2017'd&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 17:49:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325373#M62229</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-17T17:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert dates with proc sql insert into?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325425#M62238</link>
      <description>&lt;P&gt;Thank you for your help, Shmuel, the answer you provided is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it made me figure out that the column I'm trying to fill is actually datetime with a format of DATETIME22.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried adjusting your solution to&amp;nbsp;&lt;STRONG&gt;'01jan2017'dttm &lt;/STRONG&gt;but it did not work.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 19:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325425#M62238</guid>
      <dc:creator>Datino</dc:creator>
      <dc:date>2017-01-17T19:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert dates with proc sql insert into?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325429#M62240</link>
      <description>&lt;P&gt;for datetime use&amp;nbsp;&lt;STRONG&gt;'01jan2017:00:00:00'dt&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 19:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325429#M62240</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-17T19:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert dates with proc sql insert into?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325455#M62244</link>
      <description>Thank you!</description>
      <pubDate>Tue, 17 Jan 2017 20:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325455#M62244</guid>
      <dc:creator>Datino</dc:creator>
      <dc:date>2017-01-17T20:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert dates with proc sql insert into?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325458#M62245</link>
      <description>&lt;P&gt;Please don't be a lazy programmer and name &lt;STRONG&gt;datetime&lt;/STRONG&gt; values as &lt;STRONG&gt;dates&lt;/STRONG&gt;. When crossing the boundary to SAS the values are quite different and functions/actions that will work on DATES will either fail or create very unexpected results when used with DATETIMES (and vice versa).&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 20:36:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325458#M62245</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-17T20:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to insert dates with proc sql insert into?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325462#M62249</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/123840"&gt;@Datino&lt;/a&gt;&amp;nbsp;- if you decide to convert datetime to date use next code to do it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;date_var = datepart(datetime_var);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;format date_var date9.;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2017 20:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-insert-dates-with-proc-sql-insert-into/m-p/325462#M62249</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-01-17T20:41:13Z</dc:date>
    </item>
  </channel>
</rss>

