<?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: Columns with value 1 or greater in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726656#M225822</link>
    <description>&lt;P&gt;Do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input policy_no risk contents motor home cycle;
datalines;
1 1 0 1 0 0
2 0 0 0 0 1
3 0 1 1 2 1
4 1 0 0 0 0
5 1 0 0 0 1
6 0 1 1 2 0
;

data want;
   set have;
   if sum(contents, motor, home);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;policy_no risk contents motor home cycle 
1         1    0        1     0    0 
3         0    1        1     2    1 
6         0    1        1     2    0 
&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Mar 2021 09:18:55 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2021-03-16T09:18:55Z</dc:date>
    <item>
      <title>Columns with value 1 or greater</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726652#M225821</link>
      <description>&lt;P&gt;Hi I need help in extracting only policies whereby there is a &lt;STRONG&gt;value greater than or equals 1 from either contents/ motor/ home columns&lt;/STRONG&gt;..if all the values from&amp;nbsp; &lt;STRONG&gt;contents/ motor/ home&lt;/STRONG&gt; columns are 0, then delete the entire row..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;see below code for data have&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data have;
input policy_no risk contents motor home cycle;
datalines;
1 1 0 1 0 0
2 0 0 0 0 1
3 0 1 1 2 1
4 1 0 0 0 0
5 1 0 0 0 1
6 0 1 1 2 0
;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data &lt;STRONG&gt;Want&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;policy_no&amp;nbsp; &amp;nbsp;risk&amp;nbsp; contents&amp;nbsp; motor&amp;nbsp; &amp;nbsp;home&amp;nbsp; &amp;nbsp;cycle&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;
&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 09:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726652#M225821</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-03-16T09:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Columns with value 1 or greater</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726656#M225822</link>
      <description>&lt;P&gt;Do this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input policy_no risk contents motor home cycle;
datalines;
1 1 0 1 0 0
2 0 0 0 0 1
3 0 1 1 2 1
4 1 0 0 0 0
5 1 0 0 0 1
6 0 1 1 2 0
;

data want;
   set have;
   if sum(contents, motor, home);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;policy_no risk contents motor home cycle 
1         1    0        1     0    0 
3         0    1        1     2    1 
6         0    1        1     2    0 
&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Mar 2021 09:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726656#M225822</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-03-16T09:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Columns with value 1 or greater</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726661#M225825</link>
      <description>Thanks a lot..its working fine</description>
      <pubDate>Tue, 16 Mar 2021 09:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726661#M225825</guid>
      <dc:creator>Solly7</dc:creator>
      <dc:date>2021-03-16T09:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Columns with value 1 or greater</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726690#M225836</link>
      <description>&lt;P&gt;Anytime &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Mar 2021 10:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Columns-with-value-1-or-greater/m-p/726690#M225836</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2021-03-16T10:12:35Z</dc:date>
    </item>
  </channel>
</rss>

