print obseration summary using proc compare

Reply
Contributor
Posts: 49

print obseration summary using proc compare

Hello All -

Can someone help me how to print the observation summary of this result?

proc compare base=EURO24 compare=EURO25;

     var DIAGNOSIS1;

   with DIAGNOSIS;

run;

I just need to print and see observations of this data WORK.EURO25: 512.

                                                                                                                                  
                                                                                                                                   
                                                        Observation Summary                                                        
                                                                                                                                   
                                                   Observation      Base  Compare                                                  
                                                                                                                                   
                                                   First Obs           1        1                                                  
                                                   First Unequal      23       23                                                  
                                                   Last  Unequal   81198    81198                                                  
                                                   Last  Match     81200    81200                                                  
                                                   Last  Obs       81712        .                                                  
                                                                                                                                   
                            Number of Observations in Common: 81200.                                                               
                            Number of Observations in WORK.EURO24 but not in WORK.EURO25: 512.                           
                            Total Number of Observations Read from WORK.EURO24: 81712.                                        
                            Total Number of Observations Read from WORK.EURO25: 81200.                                        
                                                                                                                                   
                            Number of Observations with Some Compared Variables Unequal: 68820.                                    
                            Number of Observations with All Compared Variables Equal: 12380.                                       
                                                                                                                                   
                                                                                                                                   
                                                     Values Comparison Summary                                                     
                                                                                                                                   
                                                                       
                                                                                                                                   

Contributor
Posts: 22

Re: print obseration summary using proc compare

Hey AliMN,

     If all you want to see is the observation number and the values of the variables for each record with a difference, then this should work:

data one;
      do id = 1 to 10;
            var_one = id;
            output;
      end;
run;


data two;
      do id = 1 to 10;
            var_two = mod(id,2) + id;
            output;
      end;
run;

proc compare base=one compare=two nosummary;
      var  var_one;
      with var_two;
run;

Where the PROC COMPARE option "nosummary" leaves only the differences to be displayed.

Hope this helps,

Huey

Ask a Question
Discussion stats
  • 1 reply
  • 166 views
  • 0 likes
  • 2 in conversation