<?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: Proc SQL - Char to Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441159#M110316</link>
    <description>&lt;P&gt;A date&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;has&lt;/STRONG&gt;&lt;/U&gt; to have all three components, even if you decide to format it to show less than that.&amp;nbsp; So you need to append a default day value:&lt;/P&gt;
&lt;PRE&gt;input(cats('01',compress(date,"-")),date7.) as newdate format=monyy6, &lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Mar 2018 11:52:37 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-03-01T11:52:37Z</dc:date>
    <item>
      <title>Proc SQL - Char to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441150#M110315</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a variable called "Date" which is currently in a CHAR format $15 and the dates are displayed as Jan-18, Feb-18 etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I change this to show a date format, ideally to keep the same format if possible like Jan-18, Feb-18.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried this but the new variable just shows a '.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input(date, yymmn6.) as newdate,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 11:22:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441150#M110315</guid>
      <dc:creator>KC_16</dc:creator>
      <dc:date>2018-03-01T11:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Char to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441159#M110316</link>
      <description>&lt;P&gt;A date&amp;nbsp;&lt;U&gt;&lt;STRONG&gt;has&lt;/STRONG&gt;&lt;/U&gt; to have all three components, even if you decide to format it to show less than that.&amp;nbsp; So you need to append a default day value:&lt;/P&gt;
&lt;PRE&gt;input(cats('01',compress(date,"-")),date7.) as newdate format=monyy6, &lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Mar 2018 11:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441159#M110316</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-01T11:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Char to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441160#M110317</link>
      <description>Thanks for the reply. I have tried to use this but I get a syntax error&lt;BR /&gt;&lt;BR /&gt;as newdate format=monyy6,&lt;BR /&gt;______&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Expecting a format name.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.</description>
      <pubDate>Thu, 01 Mar 2018 11:56:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441160#M110317</guid>
      <dc:creator>KC_16</dc:creator>
      <dc:date>2018-03-01T11:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Char to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441162#M110318</link>
      <description>&lt;P&gt;Missed a dot:&lt;/P&gt;
&lt;PRE&gt;data have;
  date='Jan-18';
run;
  
proc sql;
  create table want as
  select input(cats('01',compress(date,"-")),date7.) as newdate format=monyy6.
  from have;
quit;&lt;/PRE&gt;
&lt;P&gt;Please note above how simple it is to provide test data, and show code you are using, it saves us guessing.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Mar 2018 12:03:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441162#M110318</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-03-01T12:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL - Char to Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441163#M110319</link>
      <description>Thank you RW9, that has worked. I appreciate your help once again.&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Mar 2018 12:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Char-to-Date/m-p/441163#M110319</guid>
      <dc:creator>KC_16</dc:creator>
      <dc:date>2018-03-01T12:07:05Z</dc:date>
    </item>
  </channel>
</rss>

