BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kevinmc87
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
Tim_SAS
Barite | Level 11

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

2 REPLIES 2
Tim_SAS
Barite | Level 11

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.

kevinmc87
Obsidian | Level 7

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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