BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Jinlf
Calcite | Level 5

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;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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:

Cynthia_sas_0-1624906927733.png


And here's the value for size in the Word drop down menu after the results are opened.

Cynthia_sas_1-1624906958324.png

 

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

View solution in original post

7 REPLIES 7
Ksharp
Super User
Check your papersize option after running your code by :

proc options option=papersize value;run;
Jinlf
Calcite | Level 5

I ran the code you supplied after my codes, the result of papersize was A4, not Letter.

andreas_lds
Jade | Level 19

Same problem using win64 and 9.4m7.

ballardw
Super User

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.

Cynthia_sas
SAS Super FREQ

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:

Cynthia_sas_0-1624906927733.png


And here's the value for size in the Word drop down menu after the results are opened.

Cynthia_sas_1-1624906958324.png

 

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

Jinlf
Calcite | Level 5

Thanks !  Your method is good, the papersize change to A4 using this codes:

options papersize= (21.0cm 29.7cm);

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 7 replies
  • 998 views
  • 1 like
  • 6 in conversation