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;
COMPUTE
CashWithoutBasicSurvival;
CashWithoutBasicSurvival = CommitmentBank.sum-Entertainment.sum;
ENDCOMP;
BREAK AFTER Income / summarize;
RUN;
Need your advice.
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.
This should help:
http://jpsmonline.umd.edu/SASOnlineTutor/sot12/en/60476/m40/m40_16.htm
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; compute cashwithoutbasicsurvival; cashwithoutbasicsurvival = commitmentbank.sum-entertainment.sum; endcomp; break after income / summarize; run;
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.
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.