<?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 How to format date values in Proc SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228015#M54242</link>
    <description>Given Format - YYYYMM Required Format - YYMMDD (default dd to 01) Can anyone suggest how to do it in proc sql.?</description>
    <pubDate>Thu, 01 Oct 2015 10:01:56 GMT</pubDate>
    <dc:creator>mohancs</dc:creator>
    <dc:date>2015-10-01T10:01:56Z</dc:date>
    <item>
      <title>How to format date values in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228015#M54242</link>
      <description>Given Format - YYYYMM Required Format - YYMMDD (default dd to 01) Can anyone suggest how to do it in proc sql.?</description>
      <pubDate>Thu, 01 Oct 2015 10:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228015#M54242</guid>
      <dc:creator>mohancs</dc:creator>
      <dc:date>2015-10-01T10:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date values in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228017#M54244</link>
      <description>&lt;P&gt;FORMAT= as a column option in either SELECT or CREATE statement,&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 11:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228017#M54244</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-10-01T11:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date values in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228038#M54245</link>
      <description>&lt;P&gt;Here you go:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data have;&lt;BR /&gt;informat date mmddyy10.;&lt;BR /&gt;format date mmddyy10.;&lt;BR /&gt;input date;&lt;BR /&gt;cards;&lt;BR /&gt;10/01/2015&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select date format = date9.&lt;BR /&gt;from have;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 13:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228038#M54245</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-10-01T13:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date values in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228053#M54246</link>
      <description>Is it a character or SAS date value?</description>
      <pubDate>Thu, 01 Oct 2015 14:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228053#M54246</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-10-01T14:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to format date values in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228163#M54253</link>
      <description>&lt;P&gt;Depends whether your dates are like &lt;EM&gt;a&lt;/EM&gt;, &lt;EM&gt;b&lt;/EM&gt; or &lt;EM&gt;c&lt;/EM&gt; in the following example&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  a = 201506; /* YYYYMM as a number */
  b = '01JUN2015'd; /* SAS date value with YYYYMM format */
  format b yymmn6.;
  c = "201506"; /* char version of the YYYYMM date */
run;

proc print; run;

proc sql;
select 
    mdy(mod(a, 100), 1, int(a/100)) as date_a format=yymmdd6.,
    b as date_b format=yymmdd6.,
    input(c, yymmn6.) as date_c  format=yymmdd6.
from test;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7980i70BC7D8EC99B58EB/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="dt.png" title="dt.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 12:07:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-format-date-values-in-Proc-SQL/m-p/228163#M54253</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2017-03-28T12:07:57Z</dc:date>
    </item>
  </channel>
</rss>

