<?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: count number of fields that are not null in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-fields-that-are-not-null/m-p/546451#M151308</link>
    <description>&lt;P&gt;The function nmiss returns the number of missing values, you just need to subtract the total number of vars.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set tbl;
    
    array values x1-x6;
    
    NotMissing = dim(values) - nmiss(of x1-x6);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Mar 2019 11:31:53 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2019-03-27T11:31:53Z</dc:date>
    <item>
      <title>count number of fields that are not null</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-fields-that-are-not-null/m-p/546449#M151307</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I &amp;nbsp;want to create a new calculated field that will count number of fields(from fields x1-x6) that are not null.&lt;/P&gt;
&lt;P&gt;For Id=1 &amp;nbsp;I &amp;nbsp;expect to get value 6&lt;/P&gt;
&lt;P&gt;For Id=2 &amp;nbsp;I &amp;nbsp;expect to get value 6&lt;/P&gt;
&lt;P&gt;For Id=3 &amp;nbsp;I &amp;nbsp;expect to get value 4&lt;/P&gt;
&lt;P&gt;What is the way to do it please without change the dimension of the table(without transpose)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tbl;
input ID x1 x2 x3 x4 x5 x6 ;
cards;
1 9 8 7 6 7 8
2 7 7 6 7 7 8
3 7 7 6 7 . .
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2019 11:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-fields-that-are-not-null/m-p/546449#M151307</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2019-03-27T11:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: count number of fields that are not null</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-fields-that-are-not-null/m-p/546451#M151308</link>
      <description>&lt;P&gt;The function nmiss returns the number of missing values, you just need to subtract the total number of vars.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set tbl;
    
    array values x1-x6;
    
    NotMissing = dim(values) - nmiss(of x1-x6);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Mar 2019 11:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-fields-that-are-not-null/m-p/546451#M151308</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-27T11:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: count number of fields that are not null</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-number-of-fields-that-are-not-null/m-p/546457#M151310</link>
      <description>Why not use  NotMissing = n(of x1-x6);</description>
      <pubDate>Wed, 27 Mar 2019 11:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-number-of-fields-that-are-not-null/m-p/546457#M151310</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-03-27T11:50:56Z</dc:date>
    </item>
  </channel>
</rss>

