Hi, i'm trying to set colomns width for each column of an across variable in a proc report. This is my dataset structure: STRATA1 STRATA2 _NAME_ COL1 CAT1 CAT2 NObs1 xx CAT1 CAT2 mean xxx CAT1 CAT2 std xxx CAT1 CAT2 median xxx CAT1 CAT2 Q13 xxx; xxx CAT1 CAT2 Minmax xxx; xxx This is the format code: proc format ;
value $label
"N" = "N"
"NObs1" = "n"
"mean" = "Mean"
"median" = "Median"
"std" = "Std Dev"
"Q13" = "Q1; Q3"
"Minmax" = "Min; Max"
;
run; This is the proc report code: goptions device=png;
ods listing close;
options nodate nonumber orientation = landscape nobyline;
ods rtf file= "file.rtf" style = customtemp;
title1 j=l "title";
proc report data=report missing nowd split="|" style(header)={just = center} ;
columns ("" STRATA1 STRATA2) ( _NAME_,(COL1)) dummy ;
define STRATA2 /' ' group style(column)={cellwidth=0.08in just = left};
define STRATA1 /' ' group style(column)={cellwidth=0.08in just = left};
define _NAME_ /' ' nozero across order = data style(column)={just = center} format = $label.;
define COL1 /' ' style(column)={cellwidth=0.10in just = center};
define dummy /computed noprint;
compute _NAME_;
if compress(_NAME_) = 'NObs1' then call define(_col_, "style/merge", "style=[cellwidth=0.03in]");
else if compress(_NAME_) = 'mean' then call define(_col_, "style/merge", "style=[cellwidth=0.04in]");
else if compress(_NAME_) = 'median' then call define(_col_, "style/merge", "style=[cellwidth=0.04in]");
else if compress(_NAME_) = 'std' then call define(_col_, "style/merge", "style=[cellwidth=0.04in]");
else if compress(_NAME_) = 'Q13' then call define(_col_, "style/merge", "style=[cellwidth=0.05in]");
else if compress(_NAME_) = 'Minmax' then call define(_col_, "style/merge", "style=[cellwidth=0.05in]");
endcomp;
run;
ods rtf close; It does not change the columns width. I also tryed with the following code with the same result. compute _NAME_;
if compress(_NAME_) = 'NObs1' then call define('NObs1', "style/merge", "style=[cellwidth=0.03in]");
else if compress(_NAME_) = 'mean' then call define('mean', "style/merge", "style=[cellwidth=0.04in]");
else if compress(_NAME_) = 'median' then call define('median', "style/merge", "style=[cellwidth=0.04in]");
else if compress(_NAME_) = 'std' then call define('std', "style/merge", "style=[cellwidth=0.04in]");
else if compress(_NAME_) = 'Q13' then call define('Q13', "style/merge", "style=[cellwidth=0.05in]");
else if compress(_NAME_) = 'Minmax' then call define('Minmax', "style/merge", "style=[cellwidth=0.05in]");
endcomp; could you help me?
... View more