Sample 25067: Making the labels wrap within the label column in PROC MEANS/SUMMARY
/* Creating sample data */
data test;
do i=1 to 3;
var1=int(ranuni(i)*10000);
var2=int(ranuni(i)*10300);
var3=int(ranuni(i)*10600);
label var1='Label for variable 1'
var2='Label for variable 2'
var3='Label for variable 3';
output;
end;
run;
proc template;
edit Base.Summary;
edit label;
header = "Label";
width=15; /* Added WIDTH= to default label */
id;
generic;
end;
edit mean;
header = "Mean";
format=comma10.2; /* Added FORMAT= to change default format */
generic;
end;
edit min;
define header hmin;
text "Minimum";
text2 "Min";
end;
header = hmin;
format=comma10.2;
generic;
end;
edit max;
define header hmax;
text "Maximum";
text2 "Max";
end;
header = hmax;
format=comma10.2;
generic;
end;
edit n;
header = "N";
format=comma10.;
generic;
end;
edit stddev;
header = "Std Dev";
format=comma10.2;
generic;
end;
end;
run;
options ls=100;
run;
proc means data=test maxdec=2;
var var1-var3;
run;
options ls=75;
run;
/* Run this to remove this template from SASUSER.TEMPLAT */
proc template;
delete Base.Summary;
run;
Variable Label N Mean Std Dev Minimum Maximum
var1 Label for 3 3,290.33 1,889.13 1,849.00 5,429.00
variable 1
var2 Label for 3 8,319.67 2,475.29 5,476.00 9,991.00
variable 2
var3 Label for 3 5,013.00 4,919.50 527.00 10,274.00
variable 3
The following program will modify the default template for PROC MEANS output to wrap the label within its column and use the comma format to display the statistics.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> MEANS Analytics ==> Descriptive Statistics SAS Reference ==> Procedures ==> SUMMARY
|
| Date Modified: | 2005-08-27 03:03:12 |
| Date Created: | 2005-01-26 16:16:54 |
Operating System and Release Information
| SAS System | Base SAS | All | 8 TS M0 | n/a |