<?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 Identifying number participants by subtracting date in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Identifying-number-participants-by-subtracting-date/m-p/761028#M30316</link>
    <description>&lt;P&gt;I am trying to find the number of participants between specific time period. How would be able to calculate that in SAS. For example,&amp;nbsp; How can determine the total number of hospital&amp;nbsp;visitors from 10/20/2018 - until "today" who has positive flu test&amp;nbsp; from the table below? Please help! Thank you!&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;date&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;Flu_test&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;2/8/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;negative&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;6/12/2021&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;7/10/2017&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;6/23/2020&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;5&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;8/15/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;6&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;8/24/2017&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;negative&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;12/20/2020&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the outcome will be&lt;/P&gt;
&lt;P&gt;3 = positive&lt;/P&gt;
&lt;P&gt;1 = negative&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 22:17:28 GMT</pubDate>
    <dc:creator>hjjijkkl</dc:creator>
    <dc:date>2021-08-11T22:17:28Z</dc:date>
    <item>
      <title>Identifying number participants by subtracting date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-number-participants-by-subtracting-date/m-p/761028#M30316</link>
      <description>&lt;P&gt;I am trying to find the number of participants between specific time period. How would be able to calculate that in SAS. For example,&amp;nbsp; How can determine the total number of hospital&amp;nbsp;visitors from 10/20/2018 - until "today" who has positive flu test&amp;nbsp; from the table below? Please help! Thank you!&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;ID&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;date&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;Flu_test&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;2/8/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;negative&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;6/12/2021&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;7/10/2017&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;4&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;6/23/2020&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;5&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;8/15/2019&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;6&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;8/24/2017&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;negative&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;
&lt;P&gt;7&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;12/20/2020&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="156"&gt;
&lt;P&gt;positive&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the outcome will be&lt;/P&gt;
&lt;P&gt;3 = positive&lt;/P&gt;
&lt;P&gt;1 = negative&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 22:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-number-participants-by-subtracting-date/m-p/761028#M30316</guid>
      <dc:creator>hjjijkkl</dc:creator>
      <dc:date>2021-08-11T22:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying number participants by subtracting date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-number-participants-by-subtracting-date/m-p/761030#M30317</link>
      <description>&lt;P&gt;Please post your data in usable form (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 22:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-number-participants-by-subtracting-date/m-p/761030#M30317</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-08-11T22:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Identifying number participants by subtracting date</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Identifying-number-participants-by-subtracting-date/m-p/761031#M30318</link>
      <description>&lt;P&gt;If your date is an actual SAS date value then you can use a WHERE clause to identify records after a specific date by:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where date &amp;gt; "20OCT2018"d;&lt;/P&gt;
&lt;P&gt;The literal date must be in a Date9. (or date7. or other format with DDMONYY) in quotes and followed by the letter d to tell SAS you intend the value to be treated as a date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the data step to create actual data that can be used with code. Please do so for future examples and paste into a text box opened with the &amp;lt;/&amp;gt;&amp;nbsp; (shown) or the "running man" icon that appears above the message window.&lt;/P&gt;
&lt;PRE&gt;data have;
   input ID $ date :mmddyy10. Flu_test $;
   format date mmddyy10.;
datalines;
1 2/8/2019 negative
2 6/12/2021 positive
3 7/10/2017 positive
4 6/23/2020 .
5 8/15/2019 positive
6 8/24/2017 negative
7 12/20/2020 positive
;


proc freq data=have;
   Where date &amp;gt; "20OCT2018"d; 
   tables flu_test;
run;&lt;/PRE&gt;
&lt;P&gt;If your variable Date is not numeric with a date format applied that will be the first step: get a date value.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 22:43:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Identifying-number-participants-by-subtracting-date/m-p/761031#M30318</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-11T22:43:42Z</dc:date>
    </item>
  </channel>
</rss>

