对SAS输出中的列使用proc格式

对SAS输出中的列使用proc格式,sas,format,output,Sas,Format,Output,我有以下数据 DATA HAVE; input year dz $8. area; cards; 2000 stroke 08 2000 stroke 06 2000 stroke 06 ; run; 使用proc freq后 proc freq data=have; table area*dz/ list nocum ; run; 我得到下面的输出 我想用“替换“频率”列中低于5且“百分比”列中低于0的任何值。您可以将proc freq的结果保存为数据集,然后根据需要进行报告 proc

我有以下数据

DATA HAVE;
input year dz $8. area;
cards;
2000 stroke 08
2000 stroke 06
2000 stroke 06
;
run;
使用proc freq后

proc freq data=have;
table area*dz/ list nocum ;
run;
我得到下面的输出


我想用“替换“频率”列中低于5且“百分比”列中低于0的任何值。您可以将
proc freq
的结果保存为数据集,然后根据需要进行报告

proc freq data=have noprint;
  table area*dz/ list nocum out = want;
run;

proc print;
  format COUNT count. PERCENT pcnt.;
run;
如果您希望您的
proc freq
输出结果如您所愿,而不是使用额外的报告或打印过程,您需要编写更多的代码。答案是关于ods样式的,有一篇非常好的文章:

proc freq data=have noprint;
  table area*dz/ list nocum out = want;
run;

proc print;
  format COUNT count. PERCENT pcnt.;
run;