Reputation: 233
I am trying to compare two Excel worksheets (two different workbooks). 1) I have imported both files - fine 2) I have written some code in SAS and it brings out the correct output
Now, I would like for it to only output comparison for those column headings which have the word 'biggest' in it.
Here is the code:
PROC COMPARE
BASE=WORK.DATA_201605
COMPARE=WORK.DATA_201606
out=dif
outbase
outcomp
outnoequal
listall
OUTDIF
METHOD=PERCENT
CRITERION=10.00 maxprint=(1000);
ID Mainid;
run;
Upvotes: 0
Views: 285
Reputation: 7769
Use the dictionary.columns
SQL view to determine the columns :
proc sql ; select distinct name into :VARLIST separated by ' ' from dictionary.columns where libname = 'WORK' and memname = 'DIF' and upcase(name) like '%BIGGEST%' ; quit ; proc print data=dif ; var &VARLIST ; run ;
Upvotes: 1
Reputation: 21264
Have you tried the VAR statement? Along with colon to shortcut your prefix. Something like:
Var biggest: ;
Upvotes: 0