<?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 Flagging multiple visits on the same date as 1 in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Flagging-multiple-visits-on-the-same-date-as-1/m-p/595181#M15750</link>
    <description>&lt;P&gt;Hi SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help turning this logic into a program. I am trying to count the number of visits (with the variable Count) based on unique dates. This is what my data looks like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn;
input PID&amp;nbsp;$ Date&amp;nbsp; $ Place&amp;nbsp; Provider;
datalines;
001 10/10/2019 11 456
001 10/11/2019 11 400
001&amp;nbsp;10/11/2019&amp;nbsp;11 400
001&amp;nbsp;10/12/2019&amp;nbsp;11 509
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would want an accumulating variable (Count) in my output like this;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;PID Date Place Provider Count&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001 10/10/2019 11 456 1&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001 10/11/2019 11 400 2&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001&amp;nbsp;10/11/2019&amp;nbsp;11 400 2&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001&amp;nbsp;10/12/2019&amp;nbsp;11 509 3&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 19:42:07 GMT</pubDate>
    <dc:creator>doctortimi</dc:creator>
    <dc:date>2019-10-09T19:42:07Z</dc:date>
    <item>
      <title>Flagging multiple visits on the same date as 1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flagging-multiple-visits-on-the-same-date-as-1/m-p/595181#M15750</link>
      <description>&lt;P&gt;Hi SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help turning this logic into a program. I am trying to count the number of visits (with the variable Count) based on unique dates. This is what my data looks like.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dsn;
input PID&amp;nbsp;$ Date&amp;nbsp; $ Place&amp;nbsp; Provider;
datalines;
001 10/10/2019 11 456
001 10/11/2019 11 400
001&amp;nbsp;10/11/2019&amp;nbsp;11 400
001&amp;nbsp;10/12/2019&amp;nbsp;11 509
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would want an accumulating variable (Count) in my output like this;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;PID Date Place Provider Count&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001 10/10/2019 11 456 1&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001 10/11/2019 11 400 2&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001&amp;nbsp;10/11/2019&amp;nbsp;11 400 2&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class=" language-sas"&gt;001&amp;nbsp;10/12/2019&amp;nbsp;11 509 3&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 19:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flagging-multiple-visits-on-the-same-date-as-1/m-p/595181#M15750</guid>
      <dc:creator>doctortimi</dc:creator>
      <dc:date>2019-10-09T19:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging multiple visits on the same date as 1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flagging-multiple-visits-on-the-same-date-as-1/m-p/595186#M15753</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
set dsn;
by pid Date;
retain count;
if first.pid then count=1;
else if first.date then count+1;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Oct 2019 19:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flagging-multiple-visits-on-the-same-date-as-1/m-p/595186#M15753</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-10-09T19:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Flagging multiple visits on the same date as 1</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Flagging-multiple-visits-on-the-same-date-as-1/m-p/595346#M15786</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2019 12:01:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Flagging-multiple-visits-on-the-same-date-as-1/m-p/595346#M15786</guid>
      <dc:creator>doctortimi</dc:creator>
      <dc:date>2019-10-10T12:01:34Z</dc:date>
    </item>
  </channel>
</rss>

