Hello,
I have PROC PRINT statement below. Because I would like to print out a lof of variables, it took two lines to print out one ID. Although I have used 'landscape' option in 'RTF' ODS, the MS WORD printed out two lines. Is there a way to enforce all the columns into one line while outputing? Thanks.
ods rtf file = "Pathway.rtf" style=atc sasdate; options orientation=landscape; proc print data=test; var repeat_id id studysite date Sex DOB county zipcode Race1_12 totppl check site_repeat check_n site_repeat_n; format county $25.; by studysite; run; ods rtf close;
You can try adding a PAPERSIZE option to the options statement to use a different size of paper.
The syntax for a custom paper size is Papersize (widthvalue,heightvalue). So Papersize(11in,17in) would use a logical page of 11 by 17. Which your Landscape would turn into 17in wide and 11in tall. So lines should be longer.
I think you want to set this, and possibly the orientation before the ODS RTF, at least that seemed to be more consistent for output when I have used the Papersize option.
Other options would be to reduce the fontsize used by the style or in overrides in Proc Print to reduce the length of strings. You may want to investigate margins as well. The system options leftmargin, Rightmargin, Topmargin and Bottommargin can change the amount of the page used.
You can try adding a PAPERSIZE option to the options statement to use a different size of paper.
The syntax for a custom paper size is Papersize (widthvalue,heightvalue). So Papersize(11in,17in) would use a logical page of 11 by 17. Which your Landscape would turn into 17in wide and 11in tall. So lines should be longer.
I think you want to set this, and possibly the orientation before the ODS RTF, at least that seemed to be more consistent for output when I have used the Papersize option.
Other options would be to reduce the fontsize used by the style or in overrides in Proc Print to reduce the length of strings. You may want to investigate margins as well. The system options leftmargin, Rightmargin, Topmargin and Bottommargin can change the amount of the page used.
Sometimes, all it takes is to reduce the width of some columns headings by splitting them over two or more lines, for example:
proc print data=test label split="/";
label repeat_id="Repeat/Id" studysite="Study/Site";
var repeat_id id studysite date Sex DOB county zipcode Race1_12 totppl check
site_repeat check_n site_repeat_n;
format county $25.;
by studysite;
run;
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.
Ready to level-up your skills? Choose your own adventure.