<?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: proc compare in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-compare/m-p/67094#M19181</link>
    <description>I'm not sure what output you want.&lt;BR /&gt;
&lt;BR /&gt;
Assuming I know what you want it can be done with COMPARE but is probably easier using an (array do etc.).&lt;BR /&gt;
&lt;BR /&gt;
Here is my take on proc compare.  You probably would want some code to gen the VAR/WITH statements which gets us back to (array do etc.).&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data Wt;&lt;BR /&gt;
   input Class Wt1-Wt5;&lt;BR /&gt;
   cards;&lt;BR /&gt;
1 67 89 56 56 45&lt;BR /&gt;
2 72 72 45 87 23&lt;BR /&gt;
3 43 78 99 43 88&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc compare data=wt noprint outstat=stat(where=(_type_ eq 'NDIF' and _BASE_ eq 0));&lt;BR /&gt;
   by class;&lt;BR /&gt;
   var  wt1 wt1 wt1 wt1  wt2 wt2 wt2  wt3 wt3  wt4;&lt;BR /&gt;
   with wt2-wt5          wt3-wt5      wt4-wt5  wt5;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print; &lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;Obs    Class    _VAR_    _WITH_    _TYPE_    _BASE_    _COMP_    _DIF_    _PCTDIF_&lt;BR /&gt;
&lt;BR /&gt;
 1       1       Wt3      Wt4       NDIF        0         0        .          .&lt;BR /&gt;
 2       2       Wt1      Wt2       NDIF        0         0        .          .&lt;BR /&gt;
 3       3       Wt1      Wt4       NDIF        0         0  &lt;/I&gt;      .          .&lt;BR /&gt;
[/pre]</description>
    <pubDate>Thu, 19 May 2011 11:58:36 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-05-19T11:58:36Z</dc:date>
    <item>
      <title>proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-compare/m-p/67093#M19180</link>
      <description>Can I use proc compare to compare and output equal values in more than two columns in the same dataset? Say for the following, each class has different combinations of different columns for weight, but I want them all extracted from the bigger dataset:&lt;BR /&gt;
&lt;BR /&gt;
Class       Wt1      Wt2          Wt3       Wt4        Wt5&lt;BR /&gt;
&lt;BR /&gt;
1               67         89           56         56            45&lt;BR /&gt;
2               72         72           45         87            23&lt;BR /&gt;
3               43          78          99         43            88&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Thu, 19 May 2011 04:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-compare/m-p/67093#M19180</guid>
      <dc:creator>spg</dc:creator>
      <dc:date>2011-05-19T04:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: proc compare</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-compare/m-p/67094#M19181</link>
      <description>I'm not sure what output you want.&lt;BR /&gt;
&lt;BR /&gt;
Assuming I know what you want it can be done with COMPARE but is probably easier using an (array do etc.).&lt;BR /&gt;
&lt;BR /&gt;
Here is my take on proc compare.  You probably would want some code to gen the VAR/WITH statements which gets us back to (array do etc.).&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data Wt;&lt;BR /&gt;
   input Class Wt1-Wt5;&lt;BR /&gt;
   cards;&lt;BR /&gt;
1 67 89 56 56 45&lt;BR /&gt;
2 72 72 45 87 23&lt;BR /&gt;
3 43 78 99 43 88&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc compare data=wt noprint outstat=stat(where=(_type_ eq 'NDIF' and _BASE_ eq 0));&lt;BR /&gt;
   by class;&lt;BR /&gt;
   var  wt1 wt1 wt1 wt1  wt2 wt2 wt2  wt3 wt3  wt4;&lt;BR /&gt;
   with wt2-wt5          wt3-wt5      wt4-wt5  wt5;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc print; &lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;Obs    Class    _VAR_    _WITH_    _TYPE_    _BASE_    _COMP_    _DIF_    _PCTDIF_&lt;BR /&gt;
&lt;BR /&gt;
 1       1       Wt3      Wt4       NDIF        0         0        .          .&lt;BR /&gt;
 2       2       Wt1      Wt2       NDIF        0         0        .          .&lt;BR /&gt;
 3       3       Wt1      Wt4       NDIF        0         0  &lt;/I&gt;      .          .&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 19 May 2011 11:58:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-compare/m-p/67094#M19181</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-05-19T11:58:36Z</dc:date>
    </item>
  </channel>
</rss>

