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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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