<?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: Easier way of writing Multiple combinations? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196060#M305228</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is shorter, although the format of the output is a little different:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;test = put(A1 &amp;gt; 0, 1.) || put(A2 &amp;gt; 0, 1.) || put(A3 &amp;gt; 0, 1.) || put(A4 &amp;gt; 0, 1.) || put(A5 &amp;gt; 0, 1.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides having a different format, it doesn't check for missing values vs. 0.&amp;nbsp; But it may be good enough regardless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Mar 2015 13:56:23 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2015-03-06T13:56:23Z</dc:date>
    <item>
      <title>Easier way of writing Multiple combinations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196059#M305227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to write code to track variables and display whether they get triggered or not.&lt;/P&gt;&lt;P&gt;For e.g. I have 5 variables (A1 to A5) which have different values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of the code that I have been writing is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if A1&amp;gt;0 and A2 &amp;gt;0 and a3&amp;gt;0 and a4&amp;gt;0 and A5&amp;gt;0 then test="All A1-A5";&lt;/P&gt;&lt;P&gt;else if A1&amp;gt;0 and A2 &amp;gt;0 and a3&amp;gt;0 and a4&amp;gt;0 and A5=0 then test="A1-A4" ;&lt;/P&gt;&lt;P&gt;else.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You get the picture - there are numerous combinations that can be coded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there an easier way of coding this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;yash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 12:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196059#M305227</guid>
      <dc:creator>YashSingh</dc:creator>
      <dc:date>2015-03-06T12:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Easier way of writing Multiple combinations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196060#M305228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is shorter, although the format of the output is a little different:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;test = put(A1 &amp;gt; 0, 1.) || put(A2 &amp;gt; 0, 1.) || put(A3 &amp;gt; 0, 1.) || put(A4 &amp;gt; 0, 1.) || put(A5 &amp;gt; 0, 1.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Besides having a different format, it doesn't check for missing values vs. 0.&amp;nbsp; But it may be good enough regardless.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 13:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196060#M305228</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-03-06T13:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Easier way of writing Multiple combinations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196061#M305229</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;Well, you would be looking at array processing.&amp;nbsp; Some questions though, what happens if A1-A3 &amp;gt; 0, and A6-A7?&amp;nbsp; So a basic example of arrays:&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array a{*} 8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to dim(a);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if a{i}&amp;gt;0 then ...;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 14:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196061#M305229</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-03-06T14:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Easier way of writing Multiple combinations?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196062#M305230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if min(of A1-A5) &amp;gt; 0 then test="All A1-A5";&lt;/P&gt;&lt;P&gt;else if min(of A1-A4)&amp;gt;0 and A5=0 then test="A1-A4";&lt;/P&gt;&lt;P&gt;/* your pattern isn't necessarily obvious but perhaps*/&lt;/P&gt;&lt;P&gt;else if min(of A1-A3)&amp;gt;0 and max(A4, A5)=0 then test="A1-A3";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you get to A1, A3 and A5 &amp;gt;0 and A2, A4=0 you're not going to find much simplification.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Mar 2015 16:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Easier-way-of-writing-Multiple-combinations/m-p/196062#M305230</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-03-06T16:08:21Z</dc:date>
    </item>
  </channel>
</rss>

