<?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: Counting observations separated by missing values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122635#M33697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... how about this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b+1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if missing(a) then b = .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Sep 2012 15:03:41 GMT</pubDate>
    <dc:creator>MikeZdeb</dc:creator>
    <dc:date>2012-09-15T15:03:41Z</dc:date>
    <item>
      <title>Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122634#M33696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I obtain column b?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="128"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;a&lt;/TD&gt;&lt;TD class="xl65" width="64"&gt;b&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;3&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;65&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;4&lt;/TD&gt;&lt;TD class="xl65"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;TD class="xl65"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;5&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;TD class="xl65"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;TD class="xl65"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;TD class="xl65"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;5&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;TD class="xl65"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;9&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;63&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;TD class="xl65"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;.&lt;/TD&gt;&lt;TD class="xl65"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;23&lt;/TD&gt;&lt;TD class="xl65"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;6&lt;/TD&gt;&lt;TD class="xl65"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;9&lt;/TD&gt;&lt;TD class="xl65"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;5&lt;/TD&gt;&lt;TD class="xl65"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;2&lt;/TD&gt;&lt;TD class="xl65"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20"&gt;1&lt;/TD&gt;&lt;TD class="xl65"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I would like b to restart counting every time it sees a missing value. My apologies if this technique is too simple for some of you. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Sep 2012 04:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122634#M33696</guid>
      <dc:creator>SASROCKS</dc:creator>
      <dc:date>2012-09-15T04:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122635#M33697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... how about this ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b+1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if missing(a) then b = .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Sep 2012 15:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122635#M33697</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-09-15T15:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122636#M33698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It totally worked - can't believe it was this simple. Thanks heaps dude!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Sep 2012 00:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122636#M33698</guid>
      <dc:creator>SASROCKS</dc:creator>
      <dc:date>2012-09-16T00:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122637#M33699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike,&lt;/P&gt;&lt;P&gt;Could you explain it to me once again.&lt;/P&gt;&lt;P&gt;I dint understand the question first.&lt;/P&gt;&lt;P&gt;he wants it to start counting from first when it encounters a missing value for b. whay not a?&lt;/P&gt;&lt;P&gt;Also whereever b has a missing value a also has a missing.&lt;/P&gt;&lt;P&gt;What if a doesnt have a missing value...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When it comes to the answer you posted:&lt;/P&gt;&lt;P&gt;could you explain the code b+1;&lt;/P&gt;&lt;P&gt;also if missing(a) then b=.;&amp;nbsp;&amp;nbsp; (already in the data whereever a is missing b also is missing....i dint understand the logic???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 19:50:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122637#M33699</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-18T19:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122638#M33700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... the person who posted the question has a data set that has ONLY the variable A ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;input a;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;65&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;6&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;63&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so, the code I posted reads that data set and create a new variable named B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at each pass through the data step, 1 is added to the variable B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if a missing value of A is encountered, B is set to MISSING and the count starts over again from 1 as soon as the next non-missing value of A is encountered&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the statement B+1; is a SUM statement ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289454.htm" title="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289454.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000289454.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it has some nice features:&amp;nbsp; the value of B is automatically RETAINED (NO RETAIN statement is needed to prevent B from being set to MISSING on each pass through the data step);&amp;nbsp; the initial value of the variable in the SUM statement is ZERO, not missing; even if the value of B is missing, the statement still works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* here's what I posted;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b+1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if missing(a) then b = .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;* it is equivalent to this;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data want;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;retain b 0;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set have;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b = sum(b,1);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;if missing(a) then b = .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does that help you understand?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 20:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122638#M33700</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-09-18T20:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122639#M33701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hI mIKE ,&lt;/P&gt;&lt;P&gt;i UNDERSTOOD IT BUT I HAVE A SMALL QUESTION.&lt;/P&gt;&lt;P&gt;wHEN EVER a is missing.then b is also set to missing...&lt;/P&gt;&lt;P&gt;and b+1 should have been .+1=. (a dot for the next value of b)!!!!!how did u get 1 in that place?????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 20:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122639#M33701</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-18T20:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122640#M33702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B+1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is the same as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B = SUM(B,1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;both of those statement produce a 1 as the result (a SUM statement works like a SUM function and IGNORES missing values), take a look, if I run&amp;nbsp; the SAS job ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data _null_;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b = .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b + 1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;put "SUM STATEMENT RESULTS GIVEN B IS MISSING ---&amp;gt; " b;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b = .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b = sum(b, 1);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;put "SUM FUNCTION RESULTS GIVEN B IS MISSING ---&amp;gt; " b;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b = .;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;b = b + 1;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;put "ASSIGNMENT STATEMENT RESULTS GIVEN B IS MISSING ---&amp;gt; " b;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get this in the LOG ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;SUM STATEMENT RESULTS GIVEN B IS MISSING ---&amp;gt; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;SUM FUNCTION RESULTS GIVEN B IS MISSING ---&amp;gt; 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;ASSIGNMENT STATEMENT RESULTS GIVEN B IS MISSING ---&amp;gt; .&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 21:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122640#M33702</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-09-18T21:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122641#M33703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mike fo ryour time;&lt;/P&gt;&lt;P&gt;I was reading the link about sum function&amp;nbsp; i the mean while.........&lt;/P&gt;&lt;P&gt;I got the key point :&lt;/P&gt;&lt;P&gt;IN THE EXPRESSION OF A SUM STATEMENT "SAS TREATS AN EXPRESSION THAT PRODUCES A MISSING VALUE AS ZERO"&lt;/P&gt;&lt;P&gt;THAT IS WHY IT IS BECOMING 0+1 instead of&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . (missing)+1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Isnt my understanding right???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I will try to run the code you just sent me...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a ton&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 21:14:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122641#M33703</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-18T21:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: Counting observations separated by missing values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122642#M33704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ... you're welcome and your interpretation is correct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps&amp;nbsp; if you are learning about various things is SAS, all the notes I wrote for my course are free (along with lots of other stuff) at ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.albany.edu/~msz03/epi514.html" title="http://www.albany.edu/~msz03/epi514.html"&gt;EPI 514 (COMPUTER APPLICATIONS IN EPIDEMIOLOGY a/k/a INTRODUCTION TO SAS)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2012 21:55:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Counting-observations-separated-by-missing-values/m-p/122642#M33704</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2012-09-18T21:55:54Z</dc:date>
    </item>
  </channel>
</rss>

