<?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: Convert String to date and filter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-String-to-date-and-filter/m-p/407656#M99355</link>
    <description>&lt;P&gt;Using the following will create a SAS date variable which you can then use the filter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;date=input('20170706',yymmdd8.)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wouldn't then put that function into a DATASTEP where statement but you could do it on a sub setting IF statement.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2017 14:26:51 GMT</pubDate>
    <dc:creator>ClarkLawson</dc:creator>
    <dc:date>2017-10-26T14:26:51Z</dc:date>
    <item>
      <title>Convert String to date and filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-String-to-date-and-filter/m-p/407655#M99354</link>
      <description>&lt;P&gt;I have a date, that is in text that looks like this&lt;/P&gt;&lt;P&gt;20170706&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i need to do is, convert it to a readable date and have it include in my where clause for filtering.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Similar to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where create_dt &amp;gt;= date('2017-09-01')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:22:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-String-to-date-and-filter/m-p/407655#M99354</guid>
      <dc:creator>Bellefeuille</dc:creator>
      <dc:date>2017-10-26T14:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to date and filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-String-to-date-and-filter/m-p/407656#M99355</link>
      <description>&lt;P&gt;Using the following will create a SAS date variable which you can then use the filter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;date=input('20170706',yymmdd8.)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wouldn't then put that function into a DATASTEP where statement but you could do it on a sub setting IF statement.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 14:26:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-String-to-date-and-filter/m-p/407656#M99355</guid>
      <dc:creator>ClarkLawson</dc:creator>
      <dc:date>2017-10-26T14:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Convert String to date and filter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-String-to-date-and-filter/m-p/407693#M99365</link>
      <description>&lt;P&gt;Just to complete&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/173901"&gt;@ClarkLawson&lt;/a&gt;'s answer:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The syntax to check date is:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  if date &amp;gt; '01SEP2017'd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The format to use date as literel is &lt;STRONG&gt;'ddmmmyyyy'd&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2017 15:46:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-String-to-date-and-filter/m-p/407693#M99365</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-10-26T15:46:16Z</dc:date>
    </item>
  </channel>
</rss>

