An Idea Exchange for SAS software and services

by PROC Star
on ‎01-05-2015 03:15 PM

Absolutely agree.  PROC COMPARE is one of my favorites.  But the support for ODS tables is a joke.  Might as well go old school and PROC PRINTTO to a .lst file and read that in. 

by Super User
on ‎03-02-2015 02:24 PM

Yes, PROC COMPARE is an essential part of my testing processes. It is one of SAS's hidden gems as I suspect it is not that widely used.

Actually the standard COMPARE reporting could do with some sprucing up as well.

by PROC Star

Bruce Gilsen gave a nice talk at SESUG 2017 on using PROC COMPARE to find matching variables.


Looking at his code was a reminder of how bad (IMHO) the PROC COMPARE ODS output datasets are.  It was as if we were in the pre-ODS days, where you used PROC PRINTTO to send .lst output to a file, and then parsed the file. 


Below is a printout of @Reeza's WANT dataset.  To me, this isn't really a dataset, it's just text output that was crammed into a character variable.


Obs    type                                 batch

  1     d
  2     d
  3     h                            Observation Summary
  4     h
  5     h                       Observation      Base  Compare
  6     d
  7     d                       First Obs           1        1
  8     d                       First Unequal       2        2
  9     d                       Last  Unequal       9        9
 10     d                       Last  Obs          19       19
 11     d
 12     d      Number of Observations in Common: 19.
 13     d      Total Number of Observations Read from SASHELP.CLASS: 19.
 14     d      Total Number of Observations Read from WORK.CLASS: 19.
 15     d
 16     d      Number of Observations with Some Compared Variables Unequal: 3.
 17     d      Number of Observations with All Compared Variables Equal: 16.
 18     d
 19     d
 20     h                         Values Comparison Summary
 21     h
 22     d      Number of Variables Compared with All Observations Equal: 4.
 23     d      Number of Variables Compared with Some Observations Unequal: 1.
 24     d      Total Number of Values which Compare Unequal: 3.
 25     d      Maximum Difference: 3.
 26     d
 27     h                           The COMPARE Procedure
 28     h                Comparison of SASHELP.CLASS with WORK.CLASS
 29     h                               (Method=EXACT)
 30     h
 31     h                      Variables with All Equal Values
 32     h
 33     h                           Variable  Type  Len
 34     d
 35     d                           Name      CHAR    8
 36     d                           Sex       CHAR    1
 37     d                           Age       NUM     8
 38     d                           Height    NUM     8
 39     d
 40     h                       Variables with Unequal Values
 41     h
 42     h                    Variable  Type  Len  Ndif   MaxDif
 43     d
 44     d                    Weight    NUM     8     3    3.000
 45     d


I hope this is on a list for future enhancements. 

Idea Statuses
Top Liked Authors