<?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: I want to create a new variable and see if the entire column has 0 or any value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105966#M22081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum(score, post...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Apr 2013 11:04:13 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2013-04-12T11:04:13Z</dc:date>
    <item>
      <title>I want to create a new variable and see if the entire row has 0 or any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105963#M22078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;course&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; class&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; score&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; post&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; forum&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quiz&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; assign&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; main&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="648"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD align="right" height="20" width="64"&gt;1001&lt;/TD&gt;&lt;TD align="right" width="64"&gt;2001&lt;/TD&gt;&lt;TD align="right" width="72"&gt;3001&lt;/TD&gt;&lt;TD align="right" width="64"&gt;0&lt;/TD&gt;&lt;TD align="right" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" width="64"&gt;0&lt;/TD&gt;&lt;TD align="right" width="64"&gt;0&lt;/TD&gt;&lt;TD align="right" width="64"&gt;0&lt;/TD&gt;&lt;TD align="right" width="64"&gt;0&lt;/TD&gt;&lt;TD align="right" width="64"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1001&lt;/TD&gt;&lt;TD align="right"&gt;2002&lt;/TD&gt;&lt;TD align="right"&gt;3001&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;0&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;0&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1001&lt;/TD&gt;&lt;TD align="right"&gt;2001&lt;/TD&gt;&lt;TD align="right"&gt;3001&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;0&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;0&lt;/TD&gt;&lt;TD align="right"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1001&lt;/TD&gt;&lt;TD align="right"&gt;2002&lt;/TD&gt;&lt;TD align="right"&gt;3001&lt;/TD&gt;&lt;TD align="right"&gt;5&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;0&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;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example if we see the third and fourth column has all zeros. i want to know which row has all zeros and which has atleast one value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help please&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 10:15:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105963#M22078</guid>
      <dc:creator>venkatard</dc:creator>
      <dc:date>2013-04-12T10:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: I want to create a new variable and see if the entire column has 0 or any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105964#M22079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sql: select max(score)...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 10:23:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105964#M22079</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-04-12T10:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: I want to create a new variable and see if the entire column has 0 or any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105965#M22080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the confusion it is row and not column&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 10:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105965#M22080</guid>
      <dc:creator>venkatard</dc:creator>
      <dc:date>2013-04-12T10:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: I want to create a new variable and see if the entire column has 0 or any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105966#M22081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum(score, post...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 11:04:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105966#M22081</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-04-12T11:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: I want to create a new variable and see if the entire row has 0 or any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105967#M22082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a simple flagging in a dataset. If you just want a dataset of the ids you could just keep those variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data out;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set in;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag = 1 + sum(score, post, forum, quiz, assign, main, group);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if flag = 1 then output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to just produce a report you could use sql;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;course,&amp;nbsp;&amp;nbsp; class,&amp;nbsp; user &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&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;&amp;nbsp;&amp;nbsp; (1 + &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; score +&amp;nbsp; post&amp;nbsp; +&amp;nbsp;&amp;nbsp; forum&amp;nbsp; +&amp;nbsp; quiz + assign&amp;nbsp; +&amp;nbsp;&amp;nbsp; main + group ) as flag&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from in &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where calculated flag = 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just some thoughts, hope it 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>Fri, 12 Apr 2013 11:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105967#M22082</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-04-12T11:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: I want to create a new variable and see if the entire row has 0 or any value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105968#M22083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FOUND_VALUE_FLAG=sum(of SCORE--GROUP) ne 0;&lt;/P&gt;&lt;P&gt;provided the values can only be positive.&lt;/P&gt;&lt;P&gt;Otherwise something like&lt;/P&gt;&lt;P&gt;FOUND_VALUE_FLAG=lengthn(compress(cats(of SCORE--GROUP),'0.')) ne 0;&lt;/P&gt;&lt;P&gt;will take care of any real number.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 11:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-want-to-create-a-new-variable-and-see-if-the-entire-row-has-0/m-p/105968#M22083</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2013-04-12T11:30:30Z</dc:date>
    </item>
  </channel>
</rss>

