COMPARE Procedure

Example 1: Producing a Complete Report of the Differences

Features:
PROC COMPARE statement options:
BASE=
PRINTALL
COMPARE=
Data set: PROCLIB.ONE, PROCLIB.TWO

Details

This example shows the most complete report that PROC COMPARE produces as procedure output.

Program

libname proclib 'SAS-library';
options nodate pageno=1 linesize=80 pagesize=40;
proc compare base=proclib.one compare=proclib.two printall;
   title 'Comparing Two Data Sets: Full Report';
run;

Program Description

Declare the PROCLIB SAS library.
libname proclib 'SAS-library';
Set the SAS system options. The NODATE option suppresses the display of the date and time in the output. PAGENO= specifies the starting page number. LINESIZE= specifies the output line length, and PAGESIZE= specifies the number of lines on an output page.
options nodate pageno=1 linesize=80 pagesize=40;
Create a complete report of the differences between two data sets. BASE= and COMPARE= specify the data sets to compare. PRINTALL prints a full report of the differences.
proc compare base=proclib.one compare=proclib.two printall;
   title 'Comparing Two Data Sets: Full Report';
run;
A > in the output marks information that is in the full report but not in the default report. The additional information includes a listing of variables found in one data set but not the other, a listing of observations found in one data set but not the other, a listing of variables with all equal values, and summary statistics. For an explanation of the statistics, see Table of Summary Statistics.
Part One of Comparing Two Data Sets: Full Report
Part Two of Comparing Two Data Sets: Full Report
Part Three of Comparing Two Data Sets: Full Report
Part Four of Comparing Two Data Sets: Full Report
Part Five of Comparing Two Data Sets: Full Report
Part Six of Comparing Two Data Sets: Full Report