Hi all,
I am creating a codebook using Kim Chantala's design - I'll include on the PROC REPORT statement of the design for brevity. I've specified width for each column and flow for the columns where I want to wrap text. However, my label names are quite long, and when I add these labels to my variables, it blows the formatting of the codebook up, and the columns don't abide by the specific widths that I have defined for them. Does anybody know why that is? If I could just keep my widths as I specified, I would not have a problem.
Here is my code:
proc report data=flagged_data nocenter nowindows headline wrap split='~' missing
style(header)=[color=black backgroundcolor=very light grey ]
style(summary)=[color=very light grey backgroundcolor=very light grey fontfamily="Times Roman" fontsize=1pt textalign=r];;
*style(summary)=[color=cx000000 backgroundcolor=cxD3D3D3 fontfamily="Times Roman" fontsize=10pt textalign=r];;
*style(summary)={style="border-bottom:solid"]} ;
column name label type format length mean_char order_flag range /*cnt*/ desc frequency percent; *fmt_start fmt_end ;
define order_flag/ order noprint;
define name /group width=15; /* was 15 */
define label /group flow width=40; /* was 40 */
define type / group center width=4;
define length / group center width=4;
define mean_char / group center width=10;
define range / group center width=20 ;*order=data; *was order center etc.;
define format /group width=12;
*define cnt / group noprint;
define desc / group order flow width=30; /* was 30 */
define frequency / analysis width=10; *was 10;
define percent / analysis width=8 ; *was 8;
break after name /suppress skip;
break after name /summarize suppress; * style={textdecoration=underline}; * suppress;
title3 "DATA SET: &file1 LABEL: &ds_label DATE CREATED: &ds_date";
title4 "Number of Observations: &obs_cnt";
title5 "Number of Variables: &var_cnt";
title6 "Organization of file: &organization";
run;
As you can see, each variable has a width associated with it, yet these widths are getting overriden once the long label names are applied. Please let me know if you have any idea why.
Best,
Kevin
Because you're using all those STYLE options I'm assuming that the destination is an ODS destination such as HTML or PDF. That is, you're not writing this report to the listing file. The WIDTH, CENTER, and FLOW options are for listing output only and do not affect any other destinations.
You should specify the column width and centering using style attributes such as cellwidth and just. There is no style attribute that corresponds to FLOW since that's the default behavior.
Because you're using all those STYLE options I'm assuming that the destination is an ODS destination such as HTML or PDF. That is, you're not writing this report to the listing file. The WIDTH, CENTER, and FLOW options are for listing output only and do not affect any other destinations.
You should specify the column width and centering using style attributes such as cellwidth and just. There is no style attribute that corresponds to FLOW since that's the default behavior.
Thanks a bunch, Tim! This makes sense to me. I appreciate the answer.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.