<?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 Add columns up to a specified maximum value in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Add-columns-up-to-a-specified-maximum-value/m-p/184495#M46919</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to add 3 columns of data in a table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAR_1 IND_1 IND_2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new_VAR = VAR_1 + IND_1 + IND_2&amp;nbsp; -&amp;gt; MAX of 30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two indicator variables two have 0,1 values, the first variable has a value from 0 to 30.&amp;nbsp; 30 is the maximum result I want.&amp;nbsp; How can I "neatly" add these three columns such that no resulting value is above 30? I am open to SAS SQL procedures.&amp;nbsp; I know of a messy way by creating a very lengthy case statement and subtracting 30, but would prefer the use of a more concise method, such as a function, if one exists.&amp;nbsp; Thanks in advance. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Sep 2014 18:25:55 GMT</pubDate>
    <dc:creator>EricinVA</dc:creator>
    <dc:date>2014-09-03T18:25:55Z</dc:date>
    <item>
      <title>Add columns up to a specified maximum value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-columns-up-to-a-specified-maximum-value/m-p/184495#M46919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to add 3 columns of data in a table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAR_1 IND_1 IND_2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new_VAR = VAR_1 + IND_1 + IND_2&amp;nbsp; -&amp;gt; MAX of 30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two indicator variables two have 0,1 values, the first variable has a value from 0 to 30.&amp;nbsp; 30 is the maximum result I want.&amp;nbsp; How can I "neatly" add these three columns such that no resulting value is above 30? I am open to SAS SQL procedures.&amp;nbsp; I know of a messy way by creating a very lengthy case statement and subtracting 30, but would prefer the use of a more concise method, such as a function, if one exists.&amp;nbsp; Thanks in advance. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:25:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-columns-up-to-a-specified-maximum-value/m-p/184495#M46919</guid>
      <dc:creator>EricinVA</dc:creator>
      <dc:date>2014-09-03T18:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Add columns up to a specified maximum value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-columns-up-to-a-specified-maximum-value/m-p/184496#M46920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this what you want?&lt;/P&gt;&lt;P&gt;new_VAR = min(30, VAR_1 + IND_1 + IND_2);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-columns-up-to-a-specified-maximum-value/m-p/184496#M46920</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-09-03T18:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Add columns up to a specified maximum value</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-columns-up-to-a-specified-maximum-value/m-p/184497#M46921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did the trick.&amp;nbsp; Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-columns-up-to-a-specified-maximum-value/m-p/184497#M46921</guid>
      <dc:creator>EricinVA</dc:creator>
      <dc:date>2014-09-03T18:39:12Z</dc:date>
    </item>
  </channel>
</rss>

