<?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: Cumulative count based on other variable in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462857#M14393</link>
    <description>&lt;P&gt;I'm afraid pics or screen shots doesn't help in ease of copy pasting the data values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;untested&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by pa_id sa_id;&lt;BR /&gt;if first.sa_id then do; count=0;cum_count=1;end;&lt;BR /&gt;else cum_count+1;&lt;BR /&gt;if admin='o' then count+1;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 21:17:06 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-05-16T21:17:06Z</dc:date>
    <item>
      <title>Cumulative count based on other variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462854#M14392</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA ALL ;
SET ALL ;
by pa_id sa_id admin notsorted;
IF first.admin then seq +1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I need your unreserved help.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;am using SAS version 9.4.&amp;nbsp; I want to count admin variable in cumulative fashion for value "o" by pa_id, sa_id, time.&amp;nbsp;&lt;/P&gt;&lt;P&gt;the structure of the data is given below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="prop data.PNG" style="width: 312px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20581iC96DF2BFD04D2F3D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="prop data.PNG" alt="prop data.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am expecting like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20583iC5A3C3BBC2A8CDDB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462854#M14392</guid>
      <dc:creator>Yilikal_Tesfaye</dc:creator>
      <dc:date>2018-05-16T21:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative count based on other variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462857#M14393</link>
      <description>&lt;P&gt;I'm afraid pics or screen shots doesn't help in ease of copy pasting the data values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;untested&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by pa_id sa_id;&lt;BR /&gt;if first.sa_id then do; count=0;cum_count=1;end;&lt;BR /&gt;else cum_count+1;&lt;BR /&gt;if admin='o' then count+1;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:17:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462857#M14393</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-16T21:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative count based on other variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462862#M14395</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input pa_id	sa_id 	time	Admin $;
cards;
1	11	23	o
1	11	36	o
1	11	82	p
1	12	45	o
1	12	55	p
1	12	67	o
1	12	70	o
1	12	90	o
2	13	36	o
2	13	46	o
2	13	59	p
2	14	25	p
2	14	34	o
2	14	40	p
;
data want;
set have;
by pa_id sa_id;
if first.sa_id then do; count=0;cum_count=1;end;
else cum_count+1;
if admin='o' then count+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 May 2018 21:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462862#M14395</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-16T21:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative count based on other variable</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462876#M14396</link>
      <description>&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 21:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Cumulative-count-based-on-other-variable/m-p/462876#M14396</guid>
      <dc:creator>Yilikal_Tesfaye</dc:creator>
      <dc:date>2018-05-16T21:32:12Z</dc:date>
    </item>
  </channel>
</rss>

