I'm trying to use a different data source for my reports. The alternate COMPARE dataset/table has the same observations as the old source BASE dataset/table, plus some additional observations, but the variable names are different. Some are easy to determine just by looking, but most are not intuitive at all. I want to map the two in a cross-reference, if you will, to point my code to the correct new variable names in the alternate dataset without altering the logic in the program. Is there an option in PROC COMPARE to show in two different datasets, variables having equal values but different names.
Here is my PROC COMPARE code below:
proc sort data=whse.acls_detail_all out=jesslibr.detail_all_base nodup; /* THIS IS THE BASE dataset */
by acct_num ;
run;
data jesslibr.bbacls_201005_test ;
length acct_num $ 18 ;
set jesslibr.bbacls_201005 ;
acct_num = substr(source_key_value,13,18) ;
format acct_num $18. ;
run;
proc sort data=jesslibr.bbacls_201005_test out=jesslibr.bbacls_201005_comp nodup ; /* THIS IS THE COMPARE dataset */
by acct_num ;
run;
/** Begin PROC COMPARE of the two sorted datasets. **/
ods listing close;
options linesize= 120 pagesize= 80;
proc compare base=jesslibr.detail_all_base
compare=jesslibr.bbacls_201005_comp LISTCOMPVAR BRIEFSUMMARY out=jesslibr.proc_compare_results_acls maxprint=10;
by acct_num;
title1 "Variables In May2010 dataset Acls_Detail_All of equal value but different name in May2010 dataset BBacls_201005" ;
run;
ods listing;