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

Im learning PROC REPORT but width= doesnt make any changes to my results


Here are my code:

PROC REPORT data=ALFRED.EXPENSES headline headskip nowd;
options missing='0';
COL ID Income(CommitmentBank Entertainment),sum Food Accomodation CashFlow CashWithoutBasicSurvival;
DEFINE Income/ GROUP width=25;
/*DEFINE Accomodation / style(column)=[cellwidth=11in];*/
DEFINE CommitmentBank / display style(column)=[cellwidth=11in];
DEFINE Entertainment / display width=200;
DEFINE Food / display width=105;
DEFINE CashWithoutBasicSurvival / COMPUTED;
 CashWithoutBasicSurvival = CommitmentBank.sum-Entertainment.sum;
BREAK AFTER Income / summarize;


Need your advice.


Accepted Solutions
Diamond | Level 26 RW9
Diamond | Level 26

As I mention, use cellwidth.  What is your output destination?  You will note from the article I posted that width does not work for HTML destination.

View solution in original post

Diamond | Level 26 RW9
Diamond | Level 26

This should help:


To note, I tend to always specify cellwidth (RTF/PDF output).


Also to note, if your learning, its a good idea to learn a set way of programming so your code is easy to read (as most of the time its someone else who has to look at it), for example: consistent casing, indentation:

options missing='0';

proc report data=alfred.expenses headline headskip nowd;
  columns id income(commitmentbank entertainment),sum food accomodation cashflow cashwithoutbasicsurvival;

  define income         / group width=25;
  /*define accomodation / style(column)=[cellwidth=11in];*/
  define commitmentbank / display style(column)=[cellwidth=11in];
  define entertainment  / display width=200;
  define food           / display width=105;
  define cashwithoutbasicsurvival / computed;

    cashwithoutbasicsurvival = commitmentbank.sum-entertainment.sum;

  break after income / summarize;
Quartz | Level 8
Thanks for pointing out ... however, i still couldn't find the solution that i want. I tried putting width=2 and width=9 and width=50, still the same.
Diamond | Level 26 RW9
Diamond | Level 26

As I mention, use cellwidth.  What is your output destination?  You will note from the article I posted that width does not work for HTML destination.

Barite | Level 11

You don't say, but I assume you're writing your report to an ODS destination that supports styles, such as RTF or PDF, since I see the the STYLE and CELLWIDTH option in your code. The WIDTH option applies only to listing output and has no effect in these destinations. Use CELLWIDTH instead.


The WIDTH option is ignored in styled destinations because it specifies the column width in terms of characters. Styled destinations commonly use proportional-width fonts. Counting characters doesn't have much use when the characters can have different widths. (For example, "i" vs. "m".) In styled destinations specifying the column width in measurements such as inches or millimeters (the value of the CELLWIDTH option) is much more useful.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 3 in conversation