<?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: simple loop procedure in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77018#M22313</link>
    <description>Sorry, I still honestly can't figure out what you mean. I would take a guess that you might be after something like:&lt;BR /&gt;
&lt;BR /&gt;
data output_dataset;&lt;BR /&gt;
set input_dataset;&lt;BR /&gt;
if value ne '' then count_non_missing+1;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 16 Mar 2009 14:33:02 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-03-16T14:33:02Z</dc:date>
    <item>
      <title>simple loop procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77015#M22310</link>
      <description>hi&lt;BR /&gt;
&lt;BR /&gt;
im still kind of new to sas and i need to count the number of times that a variable in a dataset is not null. I guess my problem is how to get it set up in a loop to print the final number.&lt;BR /&gt;
&lt;BR /&gt;
ex. there is a dataset and the dataset has a variable that has repeating values in the column. I need to find out how many of the repeated values recieved did not have a null value.&lt;BR /&gt;
&lt;BR /&gt;
obs               date                    &lt;B&gt;variable&lt;/B&gt;               &lt;B&gt;value&lt;/B&gt;&lt;BR /&gt;
1                    b                              g                                       h&lt;BR /&gt;
2                    b                              g                                     &lt;BR /&gt;
3                    b                              g                                       k&lt;BR /&gt;
4                    b                              g                                 &lt;BR /&gt;
5                    b                              g                                       p&lt;BR /&gt;
&lt;BR /&gt;
ex. like for this the variable "g" has 3 recieved that did not have null values. if this make any sense. I see what I need to do in my mind but I cannot get it to work.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
TDS</description>
      <pubDate>Mon, 16 Mar 2009 13:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77015#M22310</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-16T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: simple loop procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77016#M22311</link>
      <description>First of all variables are columns and observations are rows. Having a variable called variable is just going to lead to all sorts of confusion. As it has with me. I'm not really sure what you are looking for.</description>
      <pubDate>Mon, 16 Mar 2009 14:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77016#M22311</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-16T14:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: simple loop procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77017#M22312</link>
      <description>I didnt name the variable "variable" i was just using that as an example. The bold variable, is the column that I am tryin to capture a specific value. The "value" column, is the column i want to determine if it is not null. That is why I had those two columns bold. I hope this helped a little. Sorry for the confusion.</description>
      <pubDate>Mon, 16 Mar 2009 14:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77017#M22312</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-16T14:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: simple loop procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77018#M22313</link>
      <description>Sorry, I still honestly can't figure out what you mean. I would take a guess that you might be after something like:&lt;BR /&gt;
&lt;BR /&gt;
data output_dataset;&lt;BR /&gt;
set input_dataset;&lt;BR /&gt;
if value ne '' then count_non_missing+1;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 16 Mar 2009 14:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77018#M22313</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-16T14:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: simple loop procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77019#M22314</link>
      <description>OK assuming that what you are asking is that you have a variable G with values:&lt;BR /&gt;
'h'&lt;BR /&gt;
' '&lt;BR /&gt;
'k'&lt;BR /&gt;
' '&lt;BR /&gt;
'p'&lt;BR /&gt;
&lt;BR /&gt;
In a data step you could have:    if G = " " then gmisscnt +1;&lt;BR /&gt;
&lt;BR /&gt;
In SQL you could use:   count(*) where g = "" as gmisscnt&lt;BR /&gt;
&lt;BR /&gt;
to give you a variable gmisscnt with a value = to the number of missing values.</description>
      <pubDate>Mon, 16 Mar 2009 14:41:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77019#M22314</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-03-16T14:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: simple loop procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77020#M22315</link>
      <description>Thank you! that is close to what I mean...Once again sorry for the confusion.</description>
      <pubDate>Mon, 16 Mar 2009 14:42:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77020#M22315</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-16T14:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: simple loop procedure</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77021#M22316</link>
      <description>You might also investigate PROC MEANS using the N and NMISS statistics (assuming that "value" is numeric).&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 16 Mar 2009 15:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/simple-loop-procedure/m-p/77021#M22316</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-03-16T15:57:31Z</dc:date>
    </item>
  </channel>
</rss>

