<?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 frequency by group(when there is a missing value) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636959#M189314</link>
    <description>&lt;P&gt;Please do not double post. See my answer to your original post here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636946" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636946&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2020 17:18:17 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-04-02T17:18:17Z</dc:date>
    <item>
      <title>cumulative frequency by group(when there is a missing value)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636946#M189305</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; i have a data set like below. fluidvalue is a numeric column having values xx, 0 and .(missing values) .for some patid's its not present. i tried doing it by retain statement. it works well if there is no .(missing value), but its stops counting especially by not considering the values after . (missing numeric dot).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data a;&lt;/P&gt;
&lt;P&gt;input patid fluidvalue;&lt;/P&gt;
&lt;P&gt;cards;&lt;/P&gt;
&lt;P&gt;01001 30&lt;/P&gt;
&lt;P&gt;01001 34&lt;/P&gt;
&lt;P&gt;01001 0&lt;/P&gt;
&lt;P&gt;01001 23&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 80&lt;/P&gt;
&lt;P&gt;01001 0&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01002 23&lt;/P&gt;
&lt;P&gt;01002 34&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01002 45&lt;/P&gt;
&lt;P&gt;01002 0&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01002 89&lt;/P&gt;
&lt;P&gt;01002 0&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01003 23&lt;/P&gt;
&lt;P&gt;01003 45&lt;/P&gt;
&lt;P&gt;01003 45&lt;/P&gt;
&lt;P&gt;01003 56&lt;/P&gt;
&lt;P&gt;01003 90&lt;/P&gt;
&lt;P&gt;01004 0&lt;/P&gt;
&lt;P&gt;01004 90&lt;/P&gt;
&lt;P&gt;01004 98&lt;/P&gt;
&lt;P&gt;01004 23&lt;/P&gt;
&lt;P&gt;01004 0&lt;/P&gt;
&lt;P&gt;01005 0&lt;/P&gt;
&lt;P&gt;01005 0&lt;/P&gt;
&lt;P&gt;01005 0&lt;/P&gt;
&lt;P&gt;01005 23&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data result;set a;&lt;/P&gt;
&lt;P&gt;retain cum_EXDOSE;&lt;BR /&gt;if first.patid then cum_EXDOSE=fluidvalue;&lt;BR /&gt;else cum_EXDOSE=cum_EXDOSE+fluidvalue;&lt;BR /&gt;by patid;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please suggest how to do modification to this program to get the final output.I would like to solve it by using this retain statement, if possible . it would be better if someone suggests me if there is a way to get the final value next to patid across all the observations(if 01003 has 7 observation and the cum_EXDOSE is 120 then for every observation of 01003 , cum_EXDOSE&amp;nbsp; will be 120 for all the rows of 01003 ).&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 17:09:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636946#M189305</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-04-02T17:09:53Z</dc:date>
    </item>
    <item>
      <title>cumulative frequency by group(when there is a missing value)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636947#M189313</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; i have a data set like below. fluidvalue is a numeric column having values xx, 0 and .(missing values) .for some patid's its not present. i tried doing it by retain statement. it works well if there is no .(missing value), but its stops counting especially by not considering the values after . (missing numeric dot).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data a;&lt;/P&gt;
&lt;P&gt;input patid fluidvalue;&lt;/P&gt;
&lt;P&gt;cards;&lt;/P&gt;
&lt;P&gt;01001 30&lt;/P&gt;
&lt;P&gt;01001 34&lt;/P&gt;
&lt;P&gt;01001 0&lt;/P&gt;
&lt;P&gt;01001 23&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 .&lt;/P&gt;
&lt;P&gt;01001 80&lt;/P&gt;
&lt;P&gt;01001 0&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01002 23&lt;/P&gt;
&lt;P&gt;01002 34&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01002 45&lt;/P&gt;
&lt;P&gt;01002 0&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01002 89&lt;/P&gt;
&lt;P&gt;01002 0&lt;/P&gt;
&lt;P&gt;01002 .&lt;/P&gt;
&lt;P&gt;01003 23&lt;/P&gt;
&lt;P&gt;01003 45&lt;/P&gt;
&lt;P&gt;01003 45&lt;/P&gt;
&lt;P&gt;01003 56&lt;/P&gt;
&lt;P&gt;01003 90&lt;/P&gt;
&lt;P&gt;01004 0&lt;/P&gt;
&lt;P&gt;01004 90&lt;/P&gt;
&lt;P&gt;01004 98&lt;/P&gt;
&lt;P&gt;01004 23&lt;/P&gt;
&lt;P&gt;01004 0&lt;/P&gt;
&lt;P&gt;01005 0&lt;/P&gt;
&lt;P&gt;01005 0&lt;/P&gt;
&lt;P&gt;01005 0&lt;/P&gt;
&lt;P&gt;01005 23&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data result;set a;&lt;/P&gt;
&lt;P&gt;retain cum_EXDOSE;&lt;BR /&gt;if first.patid then cum_EXDOSE=fluidvalue;&lt;BR /&gt;else cum_EXDOSE=cum_EXDOSE+fluidvalue;&lt;BR /&gt;by patid;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;Please suggest how to do modification to this program to get the final output.I would like to solve it by using this retain statement, if possible . it would be better if someone suggests me if there is a way to get the final value next to patid across all the observations(if 01003 has 7 observation and the cum_EXDOSE is 120 then for every observation of 01003 , cum_EXDOSE&amp;nbsp; will be 120 for all the rows of 01003 ).&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 17:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636947#M189313</guid>
      <dc:creator>sahoositaram555</dc:creator>
      <dc:date>2020-04-02T17:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative frequency by group(when there is a missing value)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636954#M189307</link>
      <description>&lt;P&gt;I'm not entirely sure here, but I think this is what you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   do _N_ = 1 by 1 until (last.patid);
      set a;
      by patid;
      sum_fluidvalue = sum(sum_fluidvalue, fluidvalue);
   end;
   do _N_ = 1 to _N_;
      set a;
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Apr 2020 17:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636954#M189307</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-04-02T17:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: cumulative frequency by group(when there is a missing value)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636959#M189314</link>
      <description>&lt;P&gt;Please do not double post. See my answer to your original post here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636946" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636946&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 17:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/cumulative-frequency-by-group-when-there-is-a-missing-value/m-p/636959#M189314</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-04-02T17:18:17Z</dc:date>
    </item>
  </channel>
</rss>

