<?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: IF THEN statement for a combination of variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519727#M140825</link>
    <description>&lt;P&gt;So &lt;STRONG&gt;3 "or" more same value&lt;/STRONG&gt; eh?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input v1	v2	v3	v4;
cards;
1	1	3	1
1	3	1	1
1	1	2	2
1	3	2	4
2	3	1	4
1	2	1	3
;


data want;
set have;
array v v:;	
i_=1;
call sortn(of v1-v4);
do i=2 to dim(v);
if v(i)=v(i-1) then i_=sum(i_,1);
else i_=1;
if i_=3 then do; v5=v(i);leave;end;
end;
drop i:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 09 Dec 2018 05:14:37 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-12-09T05:14:37Z</dc:date>
    <item>
      <title>IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519722#M140823</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working on a data set similar to the one in the table below.&amp;nbsp; I would like to create a a fifth variable, v5, where if 3 or more the other variables (V1, V2, V3, V4) have the same value then V5 would be assigned that value as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know how to do this by brute force:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA work.eg;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET work.eg;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF v1=1 and v2=1 and v4=1 THEN v5=1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; ELSE IF v1=1 and v3=1 and v4=1 THEN v5 =1;&lt;/P&gt;
&lt;P&gt;etc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, I have to do this repeatedly for multiple values and variables and I am afraid that I will miss a possible combination.&amp;nbsp; I want like SAS to do this step for me.&amp;nbsp; How would I do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 65pt;" width="87" cellspacing="0" cellpadding="0" border="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl63" style="height: 16.0pt; width: 65pt;" width="87" height="21"&gt;
&lt;TABLE style="border-collapse: collapse; width: 260pt;" width="348" cellspacing="0" cellpadding="0" border="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl66" style="height: 16.0pt; width: 65pt;" width="87" height="21"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;v1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="xl66" style="border-left: none; width: 65pt;" width="87"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;v2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="xl66" style="border-left: none; width: 65pt;" width="87"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;v3&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="xl66" style="border-left: none; width: 65pt;" width="87"&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;v4&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl65" style="height: 16.0pt; border-top: none;" height="21"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl65" style="height: 16.0pt; border-top: none;" height="21"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl65" style="height: 16.0pt; border-top: none;" height="21"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl65" style="height: 16.0pt; border-top: none;" height="21"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl65" style="height: 16.0pt; border-top: none;" height="21"&gt;2&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 16.0pt;"&gt;
&lt;TD class="xl65" style="height: 16.0pt; border-top: none;" height="21"&gt;2&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&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; EDIT: Sorry everyone, I was got very ill and am now checking this.  Thanks for all the answers. &lt;/P&gt;
&lt;P&gt; If the variables were all categorical, how would I modify the codes to make them do the same thing? &lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 00:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519722#M140823</guid>
      <dc:creator>ajb</dc:creator>
      <dc:date>2018-12-13T00:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519727#M140825</link>
      <description>&lt;P&gt;So &lt;STRONG&gt;3 "or" more same value&lt;/STRONG&gt; eh?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
input v1	v2	v3	v4;
cards;
1	1	3	1
1	3	1	1
1	1	2	2
1	3	2	4
2	3	1	4
1	2	1	3
;


data want;
set have;
array v v:;	
i_=1;
call sortn(of v1-v4);
do i=2 to dim(v);
if v(i)=v(i-1) then i_=sum(i_,1);
else i_=1;
if i_=3 then do; v5=v(i);leave;end;
end;
drop i:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 05:14:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519727#M140825</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-09T05:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519728#M140826</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*The call sortn in the previous would have changed the order of v1-v4,
so this modified one with set have point=_n_ will
reset v1-v4 in its original order*/
data want1;
set have;
array v v:;	
i_=1;
call sortn(of v1-v4);
do i=2 to dim(v);
if v(i)=v(i-1) then i_=sum(i_,1);
else i_=1;
if i_=3 then do; v5=v(i);leave;end;
end;
set have point=_n_;
drop i:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 09 Dec 2018 05:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519728#M140826</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-09T05:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519753#M140836</link>
      <description>&lt;P&gt;Novinosrin:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data need;
   set have;
   array v v1 - v4;
   array k[4] _temporary_;
   do i = 1 to dim(v);
      k[v[i]] + 1;
   end;
   j = max(of k[*]);
   if j = 3 then v5 = k[j];
   call missing(of k[*]);
drop i j;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The program simplifies if we count&amp;nbsp; the times each V1 to V4 appears in a row. This will avoid comparison of Vs, Sorting and double passing of the Data Set. But this begs for the maximum value of&amp;nbsp; V1 to V4. In this example it is 4. This maximum value is required to size a _temporary_ array. One can use big number like 1000 which does not affect the results or its speed but it would be a waste of memory.&lt;/P&gt;
&lt;P&gt;Here comes the program:&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 15:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519753#M140836</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2018-12-09T15:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519760#M140840</link>
      <description>&lt;P&gt;You can loop from the miniumum value of v1-v4 to the maximum, counting the number of each value until you get 3 or more:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input v1 v2 v3 v4;
cards;
1	1	3	1
1	3	1	1
1	1	2	2
1	3	2	4
2	3	1	4
1	2	1	3
1	2	2	3
;
data want (drop=i);
  set have;
  do i=min(of v:) to max(of v:) until (countw(catx(',',of v:),i,'k')&amp;gt;=3);
  end;
  if i&amp;lt;=max(of v:) then v5=i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Notes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The &lt;EM&gt;&lt;STRONG&gt;catx(',', of v:)&lt;/STRONG&gt;&lt;/EM&gt; function tells sas to make a comma-separated list of values from all the "v" variables.&amp;nbsp; It is embedded in a countw function.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;The 'k' option in the &lt;EM&gt;&lt;STRONG&gt;countw function&lt;/STRONG&gt;&lt;/EM&gt; says to consider every character &lt;EM&gt;&lt;STRONG&gt;except&lt;/STRONG&gt;&lt;/EM&gt; the specified value (i) as a word separator.&amp;nbsp; So&amp;nbsp;for a string="1,2,2,2,1,3,4,4,2", the&amp;nbsp;first argument to&amp;nbsp;countw(string,2,'k') would effectively look like "2 2 2 2" and return a value of 4.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;LI&gt;The loop says to iterate through all the integers from the minimum observed value to the maximum, but to stop if any count is &amp;gt;=3.&amp;nbsp;&amp;nbsp;If none of the values meet this stopping criterion, then the loop index i will be 1+max(of v:), and you will no to not assign a value to V5&amp;nbsp; (or perhaps to assign a value of V5=0 if appropriate).&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;Also don't use the varname V5 before the loop.&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; Otherwise the expression &lt;EM&gt;&lt;STRONG&gt;(of v:)&lt;/STRONG&gt;&lt;/EM&gt; would include it.&lt;/LI&gt;
&lt;LI&gt;And of course the loop specification &lt;EM&gt;&lt;STRONG&gt;(i=min(of v:) to max(of v:)&lt;/STRONG&gt;&lt;/EM&gt; would have to be much more involved if the values were not integers.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 09 Dec 2018 18:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519760#M140840</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-12-09T18:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519762#M140842</link>
      <description>&lt;P&gt;Most elegant and great notes for the OP. et al.&amp;nbsp; Priceless!!!&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 19:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519762#M140842</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-09T19:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519770#M140845</link>
      <description>&lt;P&gt;Given that you want t match at least 3 out of 4, you can skip the in between values.&amp;nbsp; Just check the minimum value and the maximum value.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 19:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519770#M140845</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-09T19:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519806#M140866</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good point - I hadn't thought of that.&amp;nbsp; Yes, checking min and max is all that's needed, since there's no way for a non-extreme value to have a count of 3 out of 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if the user progresses to 3 out of 5,&amp;nbsp; interior values could not be skipped (i.e. 1,2,2,2,3&amp;nbsp; ==&amp;gt; newvar=2).&lt;/P&gt;</description>
      <pubDate>Sun, 09 Dec 2018 23:06:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519806#M140866</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-12-09T23:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519901#M140909</link>
      <description>&lt;P&gt;Your solution is most elegant. I was curious as to how good/bad my solution was. I simulated 100,000 rows similar to HAVE and re-ran&lt;/P&gt;
&lt;P&gt;my program. It took about:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; real time 0.04 seconds&lt;BR /&gt; user cpu time 0.04 seconds&lt;BR /&gt; system cpu time 0.00 seconds&lt;BR /&gt; memory 648.43k&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your solution took about:&lt;/P&gt;
&lt;P&gt;real time 0.22 seconds&lt;BR /&gt; user cpu time 0.21 seconds&lt;BR /&gt; system cpu time 0.00 seconds&lt;BR /&gt; memory 680.15k&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In terms of run-time, some difference is found but it will not make a big difference. So my solution is not slower compared to yours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;DataSP&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 11:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519901#M140909</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2018-12-10T11:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519941#M140935</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/17666"&gt;@ajb&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works for &lt;EM&gt;arbitrary&lt;/EM&gt; &lt;EM&gt;non-missing&lt;/EM&gt; numeric values v1 - v4:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=t);
set have;
t=largest(2,of v:);
if smallest(2,of v:)=max(of v:) | min(of v:)=t then v5=t;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And this&amp;nbsp;allows for missing (incl. special missing) values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=t);
set have;
t=ordinal(3,of v:);
if ordinal(2,of v:)=ordinal(4,of v:) | ordinal(1,of v:)=t then v5=t;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Dec 2018 13:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519941#M140935</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-12-10T13:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519966#M140939</link>
      <description>&lt;P&gt;Here is a shorter version (for arbitrary non-missing numeric values v1 - v4):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if ~mad(of v:) then v5=median(of v:);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: As an additional advantage (over the suggestion involving LARGEST() etc.) it also works&amp;nbsp;for&amp;nbsp;&lt;EM&gt;five&lt;/EM&gt; values, e.g. v0 - v4. Not for more than five, though.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 14:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/519966#M140939</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-12-10T14:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN statement for a combination of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/521043#M141335</link>
      <description>&lt;P&gt;Thanks for all the answers. If the variables were all categorical, how would I modify the codes to make them do the same thing? I am also realizing that I may have to do this for up to 16 categorical variables.&amp;nbsp; Does this make the coding much more difficult?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 00:49:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-statement-for-a-combination-of-variables/m-p/521043#M141335</guid>
      <dc:creator>ajb</dc:creator>
      <dc:date>2018-12-13T00:49:20Z</dc:date>
    </item>
  </channel>
</rss>

