<?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: Re If and then in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533954#M146447</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25743"&gt;@anilgvdbm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need a solution&amp;nbsp;in if and then conditions for multiple variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data for 10 years and each&amp;nbsp;year as one variable please find the example below&lt;/P&gt;
&lt;TABLE width="768" style="width: 576pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="width: 48pt; height: 15pt;"&gt;Cutomer ID&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year1&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year2&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year3&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year4&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year5&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year6&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year7&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year8&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year9&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year10&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;Tag&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;49&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;37&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;13&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;14&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;21&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;2&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;46&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;43&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;31&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;17&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;45&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;40&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;16&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;16&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;3&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;25&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;39&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;29&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;48&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;43&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;17&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;4&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;14&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;40&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;47&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;18&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;39&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;44&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;42&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;5&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;23&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;19&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;42&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;25&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;15&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;41&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the above table, i want to create tag as good, average and bad. how to use if and then for 10 variables at one go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the conditions&amp;nbsp;are if year1-year10 le 10 then Tag=good&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp;year1-year10 le 10 then Tag=average;&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp; year1-year10 le 10 then Tag=poor;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Request you all to suggest me how to do in otherways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;
&lt;P&gt;Anil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your example data should include at least on case each of "good", "average" and "poor". And you should indicate to us which observation or row of data is which.&lt;/P&gt;
&lt;P&gt;You rules in the if then are exactly the same for all three cases so makes little sense.&lt;/P&gt;
&lt;P&gt;By year1-year10 do you mean "subtract year10 from year1", "all values of the variables year1 through year10", "any value of the variables year1 through year10" or something else. It is not very clear from your code or narrative which is intended.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Feb 2019 15:10:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-02-08T15:10:17Z</dc:date>
    <item>
      <title>Re If and then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533881#M146427</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need a solution&amp;nbsp;in if and then conditions for multiple variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data for 10 years and each&amp;nbsp;year as one variable please find the example below&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 576pt;" border="0" width="768" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="height: 15.0pt; width: 48pt;"&gt;Cutomer ID&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year1&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year2&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year3&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year4&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year5&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year6&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year7&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year8&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year9&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;year10&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;Tag&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;49&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;37&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;26&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;21&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;2&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;46&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;43&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;24&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;31&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;17&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;45&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;40&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;16&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;16&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;3&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;25&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;39&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;29&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;48&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;43&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;17&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;4&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;40&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;47&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;18&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;39&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;44&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;42&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15.0pt; border-top: none;"&gt;5&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;23&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;19&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;42&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;26&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;24&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;25&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;41&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the above table, i want to create tag as good, average and bad. how to use if and then for 10 variables at one go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the conditions&amp;nbsp;are if year1-year10 le 10 then Tag=good&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp;year1-year10 le 10 then Tag=average;&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp; year1-year10 le 10 then Tag=poor;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Request you all to suggest me how to do in otherways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;
&lt;P&gt;Anil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 11:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533881#M146427</guid>
      <dc:creator>anilgvdbm</dc:creator>
      <dc:date>2019-02-08T11:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re If and then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533882#M146428</link>
      <description>&lt;P&gt;I am afraid your logic does not make much sense:&lt;/P&gt;
&lt;P&gt;"the conditions&amp;nbsp;are if year1-year10 le 10 then Tag=good&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp;year1-year10 le 10 then Tag=average;&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp; year1-year10 le 10 then Tag=poor;"&lt;/P&gt;
&lt;P&gt;This all means that if year1-10 is le 10 then tag should be good, average, and poor, as all are true if any value is less or equal to then 10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I mean I can do the first if for you, but I don't see how the second two logical work:&lt;/P&gt;
&lt;P&gt;Array method:&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  length flag $20;
  array year{10};
  do i=1 to 10;
    if year{i} &amp;lt;= 10 then flag="good";
  end;
run;
&lt;/PRE&gt;
&lt;P&gt;I would like to say use a function (corrected now, this is what happens when you overthink it!):&lt;/P&gt;
&lt;PRE&gt;data want;&lt;BR /&gt;  set have;&lt;BR /&gt;  length flag $20;&lt;BR /&gt;  if min(of year:)&amp;lt;=10 then flag="good";&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 11:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533882#M146428</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-08T11:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Re If and then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533925#M146442</link>
      <description>&lt;P&gt;the conditions&amp;nbsp;are if year1-year10 le 10 then Tag=good&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp;year1-year10 le 10 then Tag=average;&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp; year1-year10 le 10 then Tag=poor;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't understand the above&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 14:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533925#M146442</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-02-08T14:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Re If and then</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533954#M146447</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25743"&gt;@anilgvdbm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need a solution&amp;nbsp;in if and then conditions for multiple variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have data for 10 years and each&amp;nbsp;year as one variable please find the example below&lt;/P&gt;
&lt;TABLE width="768" style="width: 576pt; border-collapse: collapse;" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD width="64" height="20" class="xl65" style="width: 48pt; height: 15pt;"&gt;Cutomer ID&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year1&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year2&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year3&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year4&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year5&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year6&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year7&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year8&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year9&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;year10&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="width: 48pt; border-left-color: currentColor; border-left-width: medium; border-left-style: none;"&gt;Tag&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;1&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;49&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;37&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;13&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;14&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;21&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;2&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;46&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;43&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;31&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;17&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;45&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;40&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;16&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;16&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;3&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;25&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;39&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;29&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;48&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;43&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;17&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;4&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;14&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;40&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;47&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;35&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;18&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;32&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;39&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;44&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;42&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15pt;"&gt;
&lt;TD height="20" align="right" class="xl65" style="height: 15pt; border-top-color: currentColor; border-top-width: medium; border-top-style: none;"&gt;5&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;23&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;12&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;19&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;42&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;26&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;24&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;25&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;30&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;15&lt;/TD&gt;
&lt;TD align="right" class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;41&lt;/TD&gt;
&lt;TD class="xl65" style="border-top-color: currentColor; border-left-color: currentColor; border-top-width: medium; border-left-width: medium; border-top-style: none; border-left-style: none;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the above table, i want to create tag as good, average and bad. how to use if and then for 10 variables at one go.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the conditions&amp;nbsp;are if year1-year10 le 10 then Tag=good&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp;year1-year10 le 10 then Tag=average;&lt;/P&gt;
&lt;P&gt;else if&amp;nbsp; year1-year10 le 10 then Tag=poor;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Request you all to suggest me how to do in otherways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;
&lt;P&gt;Anil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your example data should include at least on case each of "good", "average" and "poor". And you should indicate to us which observation or row of data is which.&lt;/P&gt;
&lt;P&gt;You rules in the if then are exactly the same for all three cases so makes little sense.&lt;/P&gt;
&lt;P&gt;By year1-year10 do you mean "subtract year10 from year1", "all values of the variables year1 through year10", "any value of the variables year1 through year10" or something else. It is not very clear from your code or narrative which is intended.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 15:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Re-If-and-then/m-p/533954#M146447</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-08T15:10:17Z</dc:date>
    </item>
  </channel>
</rss>

