Features: |
ID statement |
Data sets: | PROCLIB.EMP95 |
libname proclib 'SAS-library';
options nodate pageno=1 linesize=80 pagesize=40;
data proclib.emp95; input #1 idnum $4. @6 name $15. #2 address $42. #3 salary 6.; datalines; 2388 James Schmidt 100 Apt. C Blount St. SW Raleigh NC 27693 92100 2457 Fred Williams 99 West Lane Garner NC 27509 33190 ... more data lines... 3888 Kim Siu 5662 Magnolia Blvd Southeast Cary NC 27513 77558 ; data proclib.emp96; input #1 idnum $4. @6 name $15. #2 address $42. #3 salary 6.; datalines; 2388 James Schmidt 100 Apt. C Blount St. SW Raleigh NC 27693 92100 2457 Fred Williams 99 West Lane Garner NC 27509 33190 ...more data lines... 6544 Roger Monday 3004 Crepe Myrtle Court Raleigh NC 27604 47007 ;
proc sort data=proclib.emp95 out=emp95_byidnum; by idnum; run; proc sort data=proclib.emp96 out=emp96_byidnum; by idnum; run;
proc compare base=emp95_byidnum compare=emp96_byidnum; id idnum; title 'Comparing Observations that Have Matching IDNUMs'; run;
data proclib.emp95; input #1 idnum $4. @6 name $15. #2 address $42. #3 salary 6.; datalines; 2388 James Schmidt 100 Apt. C Blount St. SW Raleigh NC 27693 92100 2457 Fred Williams 99 West Lane Garner NC 27509 33190 ... more data lines... 3888 Kim Siu 5662 Magnolia Blvd Southeast Cary NC 27513 77558 ; data proclib.emp96; input #1 idnum $4. @6 name $15. #2 address $42. #3 salary 6.; datalines; 2388 James Schmidt 100 Apt. C Blount St. SW Raleigh NC 27693 92100 2457 Fred Williams 99 West Lane Garner NC 27509 33190 ...more data lines... 6544 Roger Monday 3004 Crepe Myrtle Court Raleigh NC 27604 47007 ;
proc sort data=proclib.emp95 out=emp95_byidnum; by idnum; run; proc sort data=proclib.emp96 out=emp96_byidnum; by idnum; run;
Value
Comparison Results for Variables
section, PROC COMPARE
prints the nonmatching addresses and nonmatching salaries. For salaries,
PROC COMPARE computes the numerical difference and the percent difference.
Because ADDRESS is a character variable, PROC COMPARE displays only
the first 20 characters. For addresses where the observation has an
IDNUM of 0987
, 2776
,
or 3888
, the differences
occur after the 20th character and the differences do not appear in
the output. The plus sign in the output indicates that the full value
is not shown. To see the entire value, create an output data set.
See Comparing Values of Observations Using an Output Data Set (OUT=).