PROC REPORT - wrapping text and holding column width

Accepted Solution Solved
Reply
Contributor
Posts: 29
Accepted Solution

PROC REPORT - wrapping text and holding column width

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


Accepted Solutions
Solution
‎01-29-2016 03:45 PM
Super Contributor
Posts: 394

Re: PROC REPORT - wrapping text and holding column width

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.

View solution in original post


All Replies
Solution
‎01-29-2016 03:45 PM
Super Contributor
Posts: 394

Re: PROC REPORT - wrapping text and holding column width

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.

Contributor
Posts: 29

Re: PROC REPORT - wrapping text and holding column width

Thanks a bunch, Tim! This makes sense to me. I appreciate the answer.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 957 views
  • 0 likes
  • 2 in conversation