The SAS Output Delivery System and reporting techniques

proc report, column width

Reply
Contributor
Posts: 50

proc report, column width

Hi all

I am preparing some reports, for several different sections of a survey. Each section has their own set of question. In this case, these are all yes/no questions. For one section, there are several long questions​, and for other sections, the questions are short, so the tables coming from the reports are varying width. I want them all same width, and the yes/no columns the same width for each section.

Here are some examples of long and short questions (I made these up, so the content here is not important, just the lenght)

q3a do you like blue
q3b do you like green
q3c do you live in a city
q3d are you employed full time

q4a have you read any good books lately, that you would like to recommend to a friend, that you might like to see a movie about, that you might like to read on a trainride?
q4b do you use your cell phone as a social media tool, talking to friends, logging onto various social media accounts, following people?

Here are some of the sas code. I got the table width to be 100% of the page (style(report)={width=100%}). However, I tried out cellwidth, colwidth, width, in the define lines, and these didn't seem to work. The yes/no columns aren't the same for different sections, even when I use the same width, colwidth or cellwidth in the various define statements.

Any help appreciated.

/* question 3a to 3d */

title;

ods rtf file='H:\gxs03\commune2015_3ato3d.rtf' ;

options orientation = landscape ;

proc report data=onetest3 style(header)={background=white }

style(report)={ RULES=groups background=black width=100%};

column (( _label_ ('YES' Yes) ('NO' No)));

define Yes / display style(column)=[backgroundcolor=white colwidth=1in] style(header)={TEXTALIGN=c } ;

define No / display style(column)=[backgroundcolor=white colwidth=1in] style(header)={TEXTALIGN=c };

define _label_ / group  order=data style(column)=[ backgroundcolor=white PRETEXT='  ' colwidth=6in ] "QUESTIONS-ACTIVITIES";

where _name_ in('qSTDHIV15','qSTDHIV16','qSTDHIV17','qSTDHIV18');

compute before / style=[background=white fontweight=bold just=left];

line "3. Personal short questions:";

endcomp;

run;

ods rtf close;

/* question 4a to 4b */

title;

ods rtf file='H:\gxs03\commune2015_4a4b.rtf' ;

options orientation = landscape ;

proc report data=onetest3 style(header)={background=white }

style(report)={ RULES=groups background=black};

column (( _label_ ('YES' Yes) ('NO' No)));

define Yes / display style(column)=[backgroundcolor=white cellwidth=1in] style(header)={TEXTALIGN=l } ;

define No / display style(column)=[backgroundcolor=white cellwidth=1in] style(header)={TEXTALIGN=l };

define _label_ / group  order=data style(column)=[ backgroundcolor=white PRETEXT='  '  ] "QUESTIONS-ACTIVITIES";

where _name_ in('qSTDHIV19','qSTDHIV20');

compute before / style=[background=white fontweight=bold just=left];

line "4. some long questions:";

endcomp;

run;

ods rtf close;

Thanks

Gene

Ask a Question
Discussion stats
  • 0 replies
  • 1193 views
  • 0 likes
  • 1 in conversation