<?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 Non Blanks Across Multiple Columns in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124468#M10241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JW,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the Query Builder, you can create a Computed Column using an Advanced Expression and then specify the expression:&lt;/P&gt;&lt;P&gt;4-cmiss(of Col1 - Col4)&lt;/P&gt;&lt;P&gt;that is assuming your columns are named Col1, Col2, Col3 and Col4. If they are named something else such as A, B , C, D, E then you would use:&lt;/P&gt;&lt;P&gt;5-cmiss(&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;A, B , C, D, E&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;the cmiss function counts the number of missing numeric or character columns and so you want to subtract that from the number of variables you have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For details on the cmiss function, see &lt;SPAN style="color: #000000; font-family: '.HelveticaNeueUI'; font-size: 15px; text-align: -webkit-auto;"&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1tth4ltf640din1ey86ubo2lky2.htm"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1tth4ltf640din1ey86ubo2lky2.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Michelle Homes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Jul 2013 12:51:11 GMT</pubDate>
    <dc:creator>MichelleHomes</dc:creator>
    <dc:date>2013-07-02T12:51:11Z</dc:date>
    <item>
      <title>Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124466#M10239</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;I am a SAS beginner that has just started with EG 4.2, so feeling my way around.&amp;nbsp; &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table of data where the are multiple columns and I would like to count the number of non blank columns in each row and store the count into a new calculated column.&amp;nbsp; So my outcome should looks like this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; WIDTH: 100%; BORDER-TOP: #000000 1px solid; BORDER-RIGHT: #000000 1px solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;Co1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;Col2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;Col3&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;Col4&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;"&gt;&lt;STRONG&gt;New Column: Count of Non Blanks&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;1001&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;1002&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;1234&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;abc&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;1003&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;X&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;&lt;/TD&gt;&lt;TD style="TEXT-ALIGN: center; PADDING-BOTTOM: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px; PADDING-TOP: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've not been able to find any guidance on how to do this type of counting using EG query builder so if anyone could help that would be fab!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 07:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124466#M10239</guid>
      <dc:creator>Willo13</dc:creator>
      <dc:date>2013-07-02T07:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124467#M10240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JW,&lt;/P&gt;&lt;P&gt;See if it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;set old;&lt;/P&gt;&lt;P&gt;array chars(*)&amp;nbsp; _character_;&lt;/P&gt;&lt;P&gt;array num(*)&amp;nbsp; _numeric_;&lt;/P&gt;&lt;P&gt;count=0;&lt;/P&gt;&lt;P&gt;do i=1 to dim(chars);&lt;/P&gt;&lt;P&gt;if missing(chars(i))=0 then count=count+1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do j=1 to dim(num);&lt;BR /&gt;if missing(num(j))=0 then count=count+1;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;drop i j;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 12:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124467#M10240</guid>
      <dc:creator>pali</dc:creator>
      <dc:date>2013-07-02T12:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124468#M10241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JW,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the Query Builder, you can create a Computed Column using an Advanced Expression and then specify the expression:&lt;/P&gt;&lt;P&gt;4-cmiss(of Col1 - Col4)&lt;/P&gt;&lt;P&gt;that is assuming your columns are named Col1, Col2, Col3 and Col4. If they are named something else such as A, B , C, D, E then you would use:&lt;/P&gt;&lt;P&gt;5-cmiss(&lt;SPAN style="background-color: rgba(255, 255, 255, 0);"&gt;A, B , C, D, E&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;the cmiss function counts the number of missing numeric or character columns and so you want to subtract that from the number of variables you have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For details on the cmiss function, see &lt;SPAN style="color: #000000; font-family: '.HelveticaNeueUI'; font-size: 15px; text-align: -webkit-auto;"&gt;&lt;A class="jive-link-external-small" href="http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1tth4ltf640din1ey86ubo2lky2.htm"&gt;http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p1tth4ltf640din1ey86ubo2lky2.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Michelle Homes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 12:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124468#M10241</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2013-07-02T12:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124469#M10242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="817934" __jive_macro_name="user" class="jive_macro jive_macro_user active_link" href="https://communities.sas.com/" modifiedtitle="true" title="Willo13"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to offer some more explanation (and a correction). Since you mentioned being new to SAS and started out using EG I will assume that you SAS coding is not a well defined skill at this point. The code that &lt;A __default_attr="817649" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="pali"&gt;&lt;/A&gt; provided should work fine if you fit it into your program flow with a programming node. one correction needs to be made in that you want to count non blank variable entries but the missing function that is used looks for missing values and returns 1 if the variable is missing, so those two parts of the code should look for =0 and not =1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two array statements lists the variables you want the loop to look through. The way the code is written right now is one array looks through all numeric variables in the dataset and the other looks at all character variables in the dataset. The two do loops (do i ... end; do j ...end;), basically tell SAS to run through the array evaluating the missing function and if a the criteria is met increment the count variable by 1, Notice that count is set to 0 at the beginning of the data step so each observation begins with a default count of 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 12:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124469#M10242</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-07-02T12:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124470#M10243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for your reply.&amp;nbsp; It is really helpful but I am using EG so I may struggle to apply this code until I have learnt a little more.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 17:25:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124470#M10243</guid>
      <dc:creator>Willo13</dc:creator>
      <dc:date>2013-07-02T17:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124471#M10244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks!&amp;nbsp; This works perfectly and has saved me so much time - brilliant! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 17:26:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124471#M10244</guid>
      <dc:creator>Willo13</dc:creator>
      <dc:date>2013-07-02T17:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124472#M10245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does - thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 17:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124472#M10245</guid>
      <dc:creator>Willo13</dc:creator>
      <dc:date>2013-07-02T17:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124473#M10246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to hear. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jul 2013 18:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124473#M10246</guid>
      <dc:creator>MichelleHomes</dc:creator>
      <dc:date>2013-07-02T18:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124474#M10247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I wanted instead to count the number of times the total =&amp;nbsp; 0&amp;nbsp; how would I modify this code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data new;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set old;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array chars(*)&amp;nbsp; _character_;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;array num(*)&amp;nbsp; _numeric_;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;count=0;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;do i=1 to dim(chars);&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;if missing(chars(i))=0 then count=count+1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;do j=1 to dim(num);&lt;BR /&gt;if missing(num(j))=0 then count=count+1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;end;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;drop i j;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="119" style="width: 603px; height: 124px;" width="601"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="19" width="36"&gt;ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="30"&gt;C01&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="32"&gt;CO2&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="32"&gt;CO3&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="38"&gt;COL4&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="148"&gt;New Column:count of 0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="19" style="border-top: none;"&gt;1001&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;100&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="19" style="border-top: none;"&gt;1002&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;17&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl63" height="19" style="border-top: none;"&gt;1003&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;57&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;67&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 12:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124474#M10247</guid>
      <dc:creator>fred_major</dc:creator>
      <dc:date>2014-08-27T12:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124475#M10248</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;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; new_col=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array items{4} col1-col4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if items{i}=0 then new_col=new_col+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 12:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124475#M10248</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-08-27T12:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124476#M10249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry perhaps I should have used my own data and not the original post.&lt;/P&gt;&lt;P&gt;Column names and number of columns do not stay consistent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 828px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="17" width="318"&gt;_LABEL_&lt;/TD&gt;&lt;TD width="102"&gt;_25AUG2014&lt;/TD&gt;&lt;TD width="102"&gt;_24AUG2014&lt;/TD&gt;&lt;TD width="102"&gt;_23AUG2014&lt;/TD&gt;&lt;TD width="102"&gt;_22AUG2014&lt;/TD&gt;&lt;TD width="102"&gt;_21AUG2014&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;Fram&lt;/TD&gt;&lt;TD align="right"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;7&lt;/TD&gt;&lt;TD align="right"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;1310&lt;/TD&gt;&lt;TD align="right"&gt;1390&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;ans&lt;/TD&gt;&lt;TD align="right"&gt;47&lt;/TD&gt;&lt;TD align="right"&gt;16&lt;/TD&gt;&lt;TD align="right"&gt;87&lt;/TD&gt;&lt;TD align="right"&gt;231&lt;/TD&gt;&lt;TD align="right"&gt;805&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="17"&gt;Time&lt;/TD&gt;&lt;TD align="right"&gt;337&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;TD align="right"&gt;68&lt;/TD&gt;&lt;TD align="right"&gt;105&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 13:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124476#M10249</guid>
      <dc:creator>fred_major</dc:creator>
      <dc:date>2014-08-27T13:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count Non Blanks Across Multiple Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124477#M10250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok.&amp;nbsp; Note, you would need to have all variables of the same type, e.g numeric. Otherwise its more complicated as you have to do the code twice, first to convert text to number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can pre-fill some macro variables and then use those, something like:&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; NAME&lt;/P&gt;&lt;P&gt;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp; :LIST separated by ' '&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; SASHELP.VCOLUMN&lt;/P&gt;&lt;P&gt;&amp;nbsp; where&amp;nbsp;&amp;nbsp; LIBNAME="WORK"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&amp;nbsp;&amp;nbsp; MEMNAME="HAVE"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&amp;nbsp;&amp;nbsp; index(NAME,"2014")&amp;gt;0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select&amp;nbsp; count(NAME)&lt;/P&gt;&lt;P&gt;&amp;nbsp; into&amp;nbsp;&amp;nbsp;&amp;nbsp; :LIST_COUNT&lt;/P&gt;&lt;P&gt;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; SASHELP.VCOLUMN&lt;/P&gt;&lt;P&gt;&amp;nbsp; where&amp;nbsp;&amp;nbsp; LIBNAME="WORK"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&amp;nbsp;&amp;nbsp; MEMNAME="HAVE"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; and&amp;nbsp;&amp;nbsp; index(NAME,"2014")&amp;gt;0;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, same as before, but using these macros:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; new_col=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array items{&amp;amp;LIST_COUNT.} &amp;amp;LIST.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to &amp;amp;LIST_COUNT.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if items{i}=0 then new_col=new_col+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 13:44:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Count-Non-Blanks-Across-Multiple-Columns/m-p/124477#M10250</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-08-27T13:44:54Z</dc:date>
    </item>
  </channel>
</rss>

