<?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: How to calculate the number of continuous missing values in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226189#M11968</link>
    <description>Try this one :&lt;PRE&gt;data have;
input inputstation  year  month  day   var;
cards;
1          2015     1        1      54
1          2015     1        2      .
1          2015     1        3      32
1          2015     1        4      48
1          2015     1        5      52
1          2015     1        6      .
1          2015     1        7      .
1          2015     1        8      .
1          2015     1        9      49
1          2015     1       10     50
2          2015     1        1      .
2          2015     1        2      53
2          2015     1        3      .
2          2015     1        4      .
2          2015     1        5      55
2          2015     1        6      .
2          2015     1        7      .
2          2015     1        8      .
2          2015     1        9      47
2          2015     1       10     58
;
run;
data want;
count=0;
do until(last.var);
 set have;
 by inputstation  var notsorted;
 if missing(var) then count+1;
end;
do until(last.var);
set have;
 by inputstation  var notsorted;
 output;
end;
run;
 &lt;/PRE&gt;Xia Keshan</description>
    <pubDate>Fri, 18 Sep 2015 04:50:42 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2015-09-18T04:50:42Z</dc:date>
    <item>
      <title>How to calculate the number of continuous missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226178#M11967</link>
      <description>&lt;P&gt;I have a dataset like&amp;nbsp;following, and I want to use proc expand to interpolate the missing value if the number of continuous missing is less than 6. So &amp;nbsp;I need to calculate the&amp;nbsp;number of continuous missing values, and add a new variable as the number of continuous missing values to the dataset. I have 2000 stations and 30000 obs for each station, so a macro or a loop may be used to calculate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input dataset:&lt;/P&gt;&lt;P&gt;station &amp;nbsp;year &amp;nbsp;month &amp;nbsp;day &amp;nbsp; var&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;54&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; 32&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;48&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp;52&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;9&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 49&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;50&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp;53&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp;55&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;9&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 47&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;58&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;and I want to get:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;station &amp;nbsp;year &amp;nbsp;month &amp;nbsp;day &amp;nbsp; var &amp;nbsp; missing&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;54 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; 32 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;48 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp;52 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;9&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 49 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;50 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp;53 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5 &amp;nbsp; &amp;nbsp; &amp;nbsp;55 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;6&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;8&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;9&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 47 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2015 &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;58 &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thank you for help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2015 03:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226178#M11967</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2015-09-18T03:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of continuous missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226189#M11968</link>
      <description>Try this one :&lt;PRE&gt;data have;
input inputstation  year  month  day   var;
cards;
1          2015     1        1      54
1          2015     1        2      .
1          2015     1        3      32
1          2015     1        4      48
1          2015     1        5      52
1          2015     1        6      .
1          2015     1        7      .
1          2015     1        8      .
1          2015     1        9      49
1          2015     1       10     50
2          2015     1        1      .
2          2015     1        2      53
2          2015     1        3      .
2          2015     1        4      .
2          2015     1        5      55
2          2015     1        6      .
2          2015     1        7      .
2          2015     1        8      .
2          2015     1        9      47
2          2015     1       10     58
;
run;
data want;
count=0;
do until(last.var);
 set have;
 by inputstation  var notsorted;
 if missing(var) then count+1;
end;
do until(last.var);
set have;
 by inputstation  var notsorted;
 output;
end;
run;
 &lt;/PRE&gt;Xia Keshan</description>
      <pubDate>Fri, 18 Sep 2015 04:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226189#M11968</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-09-18T04:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of continuous missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226267#M11970</link>
      <description>&lt;P&gt;Thanks very much! It works very well.&lt;/P&gt;&lt;P&gt;what does "var notsorted" in "&amp;nbsp;by station &amp;nbsp;var notsorted;" means? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2015 13:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226267#M11970</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2015-09-18T13:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of continuous missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226356#M11974</link>
      <description>&lt;P&gt;And do you know how to use if statement in proc expand process?&lt;/P&gt;&lt;LI-SPOILER&gt;&amp;nbsp;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Fri, 18 Sep 2015 16:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226356#M11974</guid>
      <dc:creator>hua</dc:creator>
      <dc:date>2015-09-18T16:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of continuous missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226409#M11975</link>
      <description>&lt;P&gt;It take every side by side as a group. E.X.&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;STRONG&gt;Group&lt;/STRONG&gt;&lt;BR /&gt;1 2015 1 4 48 &amp;nbsp;&lt;STRONG&gt; 1&lt;/STRONG&gt;&lt;BR /&gt;1 2015 1 5 52 &amp;nbsp; &lt;STRONG&gt;2&lt;/STRONG&gt;&lt;BR /&gt;1 2015 1 6 . &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;BR /&gt;1 2015 1 7 . &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;BR /&gt;1 2015 1 8 52 &amp;nbsp; &lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Sep 2015 04:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226409#M11975</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-09-19T04:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of continuous missing values</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226410#M11976</link>
      <description>NO. I don't think you can use IF in proc expand.&lt;BR /&gt;But you can firstly use proc expand and padding these missing value, then use IF in data step to process what you want.</description>
      <pubDate>Sat, 19 Sep 2015 04:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-the-number-of-continuous-missing-values/m-p/226410#M11976</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-09-19T04:08:10Z</dc:date>
    </item>
  </channel>
</rss>

