<?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 Compare values across multiple variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37613#M7468</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning, Once again thanks for all the wonderfull suggestions. I tried all the suggestions. The code that fit my data and the purpose is below. if range(of nrace1-nrace5) = 0 then Race1_5='Same&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else Race1_5= 'Different'; if range(of nrace1-nrace5) = . then Race1_5='Same&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '; Other suggestons also worked. But the above code seem to be a better fit for my data maily due to missing values. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Nov 2011 14:43:44 GMT</pubDate>
    <dc:creator>rsva</dc:creator>
    <dc:date>2011-11-02T14:43:44Z</dc:date>
    <item>
      <title>Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37603#M7458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is my sample data. All variables are character variables. I want to compare v1-v4. For e.g. If v1 = v2, v3, v4, v5 or v1 ne v2, v3, v4, v5 Overall goal is to see if the values were same in all 5 variables or not Id V1 V2 V3 v4 ------------------------------------------------------------- 23 1 3 4 . 4 3 3 . . 5 5 . . . 78 7 5 3 . 246 9 9 . . 778 1 1 . . 36 3 2 . . 476 4 . . . 87 5 2 1 . 4779 8 8 . . 4587689 2 6 . . 3457 1 . . . 6879 4 4 . . Is there a simpler way to do so without a bunch of if-then statements? Thanks in advance. Aruna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 19:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37603#M7458</guid>
      <dc:creator>rsva</dc:creator>
      <dc:date>2011-10-28T19:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37604#M7459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simple idea:&amp;nbsp; test if the range is 0 or not.&amp;nbsp; If it is 0, then all non-missing values are the same.&amp;nbsp; If not, there is spread amongst the values.&amp;nbsp; Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data same different;&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; if range(of v1-v5) = 0 then output same;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else output different;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that if there are missing values in the arguments, this WON'T detect its presence.&amp;nbsp; You'll need additional logic to handle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Daymond Ling&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 19:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37604#M7459</guid>
      <dc:creator>DLing</dc:creator>
      <dc:date>2011-10-28T19:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37605#M7460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said that they were all character variable, but then showed numbers in your example.&amp;nbsp; Are they all numbers in a character variable? and, if so, are they all integers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 20:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37605#M7460</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-28T20:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37606#M7461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; A kludge which works if numeric or character:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rc = sum ( (v1 ne v2),(v1 ne v3),(v1 ne v4),(v1 ne v5));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rc will have the number of mismatches.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This uses the behavior of SAS to return 1 for a true logical comparison and 0 for a false. Care needs to be exercised for missing or blanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 20:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37606#M7461</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-10-28T20:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37607#M7462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or, taking the kludge concept one step further, in the following sum will be equal to the number of matches between any of the pairs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat v1-v5 $8.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input v1-v5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;12 A B 14 12&lt;/P&gt;&lt;P&gt;C X 12 X 5&lt;/P&gt;&lt;P&gt;1 2 3 4 5&lt;/P&gt;&lt;P&gt;a b c d e&lt;/P&gt;&lt;P&gt;a a 3 b b&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want (drop=i j);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array vars $8. v1-v5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to dim(vars)-1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=i+1 to dim(vars);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum=sum (sum, vars(i) eq vars(j));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Oct 2011 20:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37607#M7462</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-10-28T20:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37608#M7463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ... if you don't mind reading the data set twice, here's another idea that takes into account possible missing values ...&lt;/P&gt;&lt;P&gt;variable SAME is 1 if all values are the same, otherwise it's 0 ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data want&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;call sortc (of v:);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;same = ifn (coalescec(of v:) eq v5, 1 , 0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;set have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 00:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37608#M7463</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-10-31T00:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37609#M7464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you like Hash Table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
&amp;nbsp; informat v1-v5 $8.;
&amp;nbsp; input v1-v5;
&amp;nbsp; cards;
12 A B 14 12
C X 12 X 5
1 2 3 4 5
a b c d e
a a a a a
;
run;
data want(drop=i k);
 set have;
 declare hash ha (hashexp:10);
&amp;nbsp; ha.definekey('k');
&amp;nbsp; ha.definedone();
 array _v{*} v:;
 do i=1 to dim(_v);
&amp;nbsp; k=_v{i};ha.replace();
 end;
 flag=ifc(ha.num_items=1,'All Same&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ','Not All Same');
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 03:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37609#M7464</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-10-31T03:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37610#M7465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found array is more simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
&amp;nbsp; informat v1-v5 $8.;
&amp;nbsp; input v1-v5;
&amp;nbsp; cards;
12 A B 14 12
C X 12 X 5
1 1 1 1 1
a b c d e
a a a a a
;
run;
data want(drop=count i);
 set have;
 array _v{*} v:;
 count=0;
 do i=1 to dim(_v);
&amp;nbsp; count+(_v{1}=_v{i});
 end;
 flag=ifc(count=dim(_v),'All Same&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ','Not All Same');
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 03:54:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37610#M7465</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-10-31T03:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37611#M7466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks a lot for all your responses. They all seem to work on my test dataset. I'll get back with the results from my original dataset. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Oct 2011 16:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37611#M7466</guid>
      <dc:creator>rsva</dc:creator>
      <dc:date>2011-10-31T16:42:23Z</dc:date>
    </item>
    <item>
      <title>Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37612#M7467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Wow! Why doesn't coalescec always return v1 if v1 isn't missing in this case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 04:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37612#M7467</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2011-11-02T04:25:00Z</dc:date>
    </item>
    <item>
      <title>Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37613#M7468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning, Once again thanks for all the wonderfull suggestions. I tried all the suggestions. The code that fit my data and the purpose is below. if range(of nrace1-nrace5) = 0 then Race1_5='Same&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else Race1_5= 'Different'; if range(of nrace1-nrace5) = . then Race1_5='Same&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '; Other suggestons also worked. But the above code seem to be a better fit for my data maily due to missing values. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 14:43:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37613#M7468</guid>
      <dc:creator>rsva</dc:creator>
      <dc:date>2011-11-02T14:43:44Z</dc:date>
    </item>
    <item>
      <title>Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37614#M7469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Because "call sortc (of v: )" has sorted the variables. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 15:46:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37614#M7469</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-11-02T15:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37615#M7470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;?? Linlin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand now (is my brain getting slower?), coalescec &lt;STRONG&gt;does&lt;/STRONG&gt; return v1 and if is is the same as v5, then they are all equal. Smart! (and obvious once you understand, as always for smart solutions).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if the OP wants to take missing values into account or if there are none, this simply becomes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;same = ifn (v1 eq v5, 1 , 0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks for this Mike, an innovative (for me) way to use sortc() across dataset variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your solution is equivalent to&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;same = ifn (min(of v:) eq max(of v:), 1 , 0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;except it works for strings and requires a prior sort. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 20:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37615#M7470</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2011-11-02T20:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37616#M7471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that you can write your existing logic as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;RACE1_5 = ifc (r&lt;/STRONG&gt;ange(of NRACE1-NRACE5) in(., 0), 'Same', 'Different' );&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 20:23:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37616#M7471</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2011-11-02T20:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Compare values across multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37617#M7472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; &lt;/SPAN&gt;Hi ... but you did say "All variables are character variables" , yes/no?, and range is specific to numeric data.&lt;/P&gt;&lt;P&gt;If they are character variables but the values are numerals, it will work, otherwise no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;input (race1-race5) (: $1.);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1 1 1 1 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1 2 3 4 5&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;1 . 1 . 1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;a b c d e&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;set x;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;same = ifc ( range(of r:)&amp;nbsp; , 'different' , 'same');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;race1&amp;nbsp;&amp;nbsp;&amp;nbsp; race2&amp;nbsp;&amp;nbsp;&amp;nbsp; race3&amp;nbsp;&amp;nbsp;&amp;nbsp; race4&amp;nbsp;&amp;nbsp;&amp;nbsp; race5&amp;nbsp;&amp;nbsp;&amp;nbsp; same&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&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;&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;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; same&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; different&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp; same&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp; a&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; same&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then there's the LOG messages ... the first NOTE is why it works with numerals.&amp;nbsp; The others are why it does not work with other values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2360:24&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Invalid numeric data, race1='a' , at line 2360 column 24.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Invalid numeric data, race2='b' , at line 2360 column 24.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Invalid numeric data, race3='c' , at line 2360 column 24.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Invalid numeric data, race4='d' , at line 2360 column 24.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Invalid numeric data, race5='e' , at line 2360 column 24.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;race1=a race2=b race3=c race4=d race5=e same=same _ERROR_=1 _N_=4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;NOTE: Missing values were generated as a result of performing an operation on missing values.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 at 2360:14&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 21:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-values-across-multiple-variables/m-p/37617#M7472</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2011-11-02T21:25:16Z</dc:date>
    </item>
  </channel>
</rss>

