The SAS Output Delivery System and reporting techniques

proc report error: adjust column width or line size

Reply
Regular Contributor
Posts: 196

proc report error: adjust column width or line size

I'm currently receiving the following error for my "bar" variable.

The max value of per_osha11 is 24.
How do I fix this error?
Thank you.

ERROR: The width of bar is not between 1 and 98. Adjust the column width or line size.
NOTE: This affects LISTING output.

proc report data=task_tot3 nowd contents="Claims" out=test
style(header)=[font_weight=bold background=CX90D9D7]
style(report)=[frame=void rules=none cellpadding=1 cellspacing=0];
options missing='0';
column bar task1 tot_osha11 per_osha11;
define task1 / 'Task';
define bar / '' style(column)=[cellwidth=75mm font_size=4pt font_face=webdings vjust=middle just=left cellpadding=0];
define tot_osha11 / analysis "Total 2011" style(column)={background=CXE599A7};
define per_osha11 / analysis "% of 2010 Total" style(column)={borderrightcolor=black borderrightwidth=1pt};
rbreak after / summarize;
compute bar / char length=100;
  barsize=round(per_osha11.sum*50);
  if barsize gt 0 then
  bar=repeat('67'x,barsize);
endcomp;
compute per_osha11;
  if _break_="_RBREAK_" then per_osha11.sum=100;
endcomp;
compute tot_osha11;
  if _break_="_RBREAK_" then call define(_row_,"style","style=[background=CXE599A7]");
  if _break_="_RBREAK_" then task1="Total 2010 - 2011";
endcomp;
run;

Valued Guide
Posts: 632

proc report error: adjust column width or line size

Without asking why; you want a repeated character up to 100 times in the first column, but is that what you want?

If the error is a listing destination error and you are not using the listing destination, turn it off ( ods listing closeSmiley Wink

My memory says that in the listing destination a given column cannot be wider than the width of the paper (LINESIZE= system option).  So increasing the LINESIZE might change the error.

In the COMPUTE BAR block you multiply per_osha11 by 50, any value of per_osha11>2 (it can be up to 24) would give a total gt 100.  any value of barsize>99 will give a bar with ge 100 characters.

SAS Super FREQ
Posts: 8,744

proc report error: adjust column width or line size

Hi:

  Art's memory is correct. That message usually appears because the LISTING destination is still open and the calculated size of a column when added to the calculated size of the other columns will exceed the current LINESIZE setting. The fix is to use

ODS LISTING CLOSE;

before the ODS step.

cynthia

Ask a Question
Discussion stats
  • 2 replies
  • 8074 views
  • 4 likes
  • 3 in conversation