<?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 filter dates based on character isodate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610955#M178021</link>
    <description>&lt;P&gt;what if the date is in char and is in "12 JAN 2019" format.&lt;/P&gt;
&lt;P&gt;i tried&amp;nbsp;where input(strip(chard),date9.) &amp;lt;= '12JAN2019'd; but it didnt work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2019 11:34:40 GMT</pubDate>
    <dc:creator>noda6003</dc:creator>
    <dc:date>2019-12-11T11:34:40Z</dc:date>
    <item>
      <title>how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610759#M177916</link>
      <description>&lt;P&gt;I think i asked smiliar question but since a new question arised want to know how to filter on date with character date which is in "2017-02-16T14:25:10" format. i need to filter on date less than or equal to 10jan2019 based on character date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used the below but it didnt work&lt;/P&gt;
&lt;P&gt;if input(chdt, is8601dt.) le 2019-01-10;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;any help&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 16:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610759#M177916</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2019-12-10T16:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610761#M177918</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where input(chdt, yymmdd10.)&amp;lt;='10JAN2019'd;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp; &amp;nbsp;Basically, the idea is to read the first 10 bytes of chars using the informat yymmdd10. as the pattern resembles year-month-date&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 16:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610761#M177918</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-10T16:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610768#M177921</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input datec $19.;
	cards;
2017-02-16T14:25:10
;
run;

data want;
	set have;
	if datepart(input(datec,is8601dt.)) le '10JAN2019'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Dec 2019 16:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610768#M177921</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-10T16:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610775#M177928</link>
      <description>&lt;P&gt;One nice thing about date strings in YYYY-MM-DD order is that they sort lexicographically in the same order as they do chronologically.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if chdt le '2019-01-10';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Dec 2019 16:50:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610775#M177928</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-10T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610793#M177934</link>
      <description>&lt;P&gt;You can also use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if datepart(input(chdt,e8601dt.)) le input("2019-01-10",yymmdd10.);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Dec 2019 18:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610793#M177934</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-10T18:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610955#M178021</link>
      <description>&lt;P&gt;what if the date is in char and is in "12 JAN 2019" format.&lt;/P&gt;
&lt;P&gt;i tried&amp;nbsp;where input(strip(chard),date9.) &amp;lt;= '12JAN2019'd; but it didnt work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 11:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610955#M178021</guid>
      <dc:creator>noda6003</dc:creator>
      <dc:date>2019-12-11T11:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610957#M178023</link>
      <description>&lt;P&gt;You use the wrong function; strip() removes leading and trailing blanks, but you want to remove all blanks, so use compress():&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input chard $11.;
datalines;
12 jan 2019
13 jan 2019
;

data want;
set have;
where input(compress(chard),date9.) &amp;lt;= '12JAN2019'd;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Dec 2019 11:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610957#M178023</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-11T11:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610964#M178027</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp; For embedded blanks, just read 2 more bytes of chars, so instead of date9. , use date11.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data w;
k=input("12 JAN 2019",date11.);
format k date9.;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;what if the date is in char and is in "12 JAN 2019" format.&lt;/P&gt;
&lt;P&gt;i tried&amp;nbsp;where input(strip(chard),date9.) &amp;lt;= '12JAN2019'd; but it didnt work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any suggestions&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 12:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610964#M178027</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-11T12:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter dates based on character isodate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610965#M178028</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240711"&gt;@noda6003&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can replace the strip() function by the compress() function to remove blanks.&lt;/P&gt;
&lt;P&gt;Indeed, the strip() function can only remove leading and trailing blanks.&lt;/P&gt;
&lt;P&gt;The compress() function remove all blanks.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 12:45:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-filter-dates-based-on-character-isodate/m-p/610965#M178028</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-11T12:45:38Z</dc:date>
    </item>
  </channel>
</rss>

