I was tring to output my result to word using ODS WORD, The following is test code, the option "papersize=A4" did not work and the papersize was "letter" in the output file. When i changed the destination to ODS RTF, it works. My SAS version is 9.4 M7 fo linux 64. I dont know why.
%let path = ......;
title;
options nodate nonumber papersize=A4;
ods escapechar="^";
ods graphics on;
ods word file="&path.toc2.docx";
proc freq data=sashelp.class;
tables sex*age/plots=freq;
run;
ods word close;
proc setinit;run;
Hi:
And another consideration is that according to the doc, PAPERSIZE is impacted by LOCALE. So maybe there's something in ODS WORD that is using the default instead of what you want. The default papersize, in fact, is set according to Locale. But I ran this test using ODS WORD and when I opened the .DOCX file with Word, the papersize showed as A4 inside WORD.
Here's my log and you can see the specific value I used for the PAPERSIZE option:
And here's the value for size in the Word drop down menu after the results are opened.
Running 9.4 M7 but on a Windows box. Also, check your printer drivers. The doc specifically says that "If you specify a predefined paper size or a custom size that is not supported by your printer, the printer default paper size is used." So that might be causing issues too.
Cynthia
I ran the code you supplied after my codes, the result of papersize was A4, not Letter.
Same problem using win64 and 9.4m7.
ODS Word I believe is still "pre-production". In effect that means not everything is going to work as expected and shouldn't be expected to be stable.
My limited use with ODS Word is table output is problematic depending on procedure and options active though I've okay luck with graphic output from Sgplot.
Hi:
And another consideration is that according to the doc, PAPERSIZE is impacted by LOCALE. So maybe there's something in ODS WORD that is using the default instead of what you want. The default papersize, in fact, is set according to Locale. But I ran this test using ODS WORD and when I opened the .DOCX file with Word, the papersize showed as A4 inside WORD.
Here's my log and you can see the specific value I used for the PAPERSIZE option:
And here's the value for size in the Word drop down menu after the results are opened.
Running 9.4 M7 but on a Windows box. Also, check your printer drivers. The doc specifically says that "If you specify a predefined paper size or a custom size that is not supported by your printer, the printer default paper size is used." So that might be causing issues too.
Cynthia
Thanks ! Your method is good, the papersize change to A4 using this codes:
options papersize= (21.0cm 29.7cm);
options papersize='A4';
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 25. Read more here about why you should contribute and what is in it for you!
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.