[英]How do I output comparison for certain columns only using SAS?
I am trying to compare two Excel worksheets (two different workbooks). 我正在尝试比较两个Excel工作表(两个不同的工作簿)。 1) I have imported both files - fine 2) I have written some code in SAS and it brings out the correct output 1)我已经导入了两个文件-很好2)我已经在SAS中编写了一些代码,它可以带来正确的输出
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;
Use the dictionary.columns
SQL view to determine the columns : 使用dictionary.columns
SQL视图确定列:
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 ;
Have you tried the VAR statement? 您是否尝试过VAR语句? Along with colon to shortcut your prefix. 连同冒号可以缩短您的前缀。 Something like: 就像是:
Var biggest: ;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.