<?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: Subsetting data with date and string for a do function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/238042#M43690</link>
    <description>&lt;P&gt;Hello Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got the solution, However if I use 'between and' for a date, and if I use 'Where' or 'IF' I am not getting the expected results, is it like if I am using 'between and' for a date can't I use 'where' and 'IF'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Dec 2015 11:25:32 GMT</pubDate>
    <dc:creator>Prash</dc:creator>
    <dc:date>2015-12-07T11:25:32Z</dc:date>
    <item>
      <title>Subsetting data with date and string for a do function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/237953#M43661</link>
      <description>&lt;P&gt;I am getting error for this code, not knowing where I am missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; centre in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Shai'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Hub'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'imen'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) and Date_of_Birth between mdy(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1953&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) and mdy(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1974&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; status = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'pass'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Not sure where I am missing, I tried with where as well but not succeeding, apart from that also checked with do end , But could not get the required result, Can any one help on this &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thanks &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2015 15:23:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/237953#M43661</guid>
      <dc:creator>Prash</dc:creator>
      <dc:date>2015-12-05T15:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data with date and string for a do function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/237955#M43662</link>
      <description>&lt;P&gt;Seems like you need set statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;set&amp;nbsp;have;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; centre in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Shai'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Hub'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'imen'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) and Date_of_Birth between mdy(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1953&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) and mdy(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1974&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; status = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'pass'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 Dec 2015 16:17:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/237955#M43662</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-12-05T16:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data with date and string for a do function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/237960#M43665</link>
      <description>Also, you can't use BETWEEN with an IF statement, only a WHERE statement. So either change to where or switch the comparison to mdy(3, 1, 1953)&amp;lt;=date_of_birth&amp;lt;=mdy(6, 30, 1974)</description>
      <pubDate>Sat, 05 Dec 2015 18:09:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/237960#M43665</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-05T18:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data with date and string for a do function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/238032#M43687</link>
      <description>&lt;P&gt;Agree with you,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Actually it has to be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It was a typo sorry for that. However running the mentioned codes by replacing with Set is not deriving the expected result&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 08:17:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/238032#M43687</guid>
      <dc:creator>Prash</dc:creator>
      <dc:date>2015-12-07T08:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data with date and string for a do function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/238042#M43690</link>
      <description>&lt;P&gt;Hello Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got the solution, However if I use 'between and' for a date, and if I use 'Where' or 'IF' I am not getting the expected results, is it like if I am using 'between and' for a date can't I use 'where' and 'IF'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 11:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/238042#M43690</guid>
      <dc:creator>Prash</dc:creator>
      <dc:date>2015-12-07T11:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Subsetting data with date and string for a do function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/238121#M43721</link>
      <description>&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Try:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; centre in (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Shai'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'Hub'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'imen'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) and (mdy(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;01&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1953&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)&amp;nbsp;le Date_of_Birth&amp;nbsp;le&amp;nbsp;mdy(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;30&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1974&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; status = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'pass'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2015 18:04:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Subsetting-data-with-date-and-string-for-a-do-function/m-p/238121#M43721</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-07T18:04:57Z</dc:date>
    </item>
  </channel>
</rss>

