BookmarkSubscribeRSS Feed
AliMN
Calcite | Level 5

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                                                     
                                                                                                                                   
                                                                       
                                                                                                                                   

1 REPLY 1
hdodson_pacificmetrics_com
Calcite | Level 5

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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 668 views
  • 0 likes
  • 2 in conversation