Custom margins for ODS WORD destination output must be set by using a global OPTIONS statement


When you want to set custom margins for output that is written to the ODS WORD destination, you must use a global OPTIONS statement. The OPTIONS statement also must appear before the opening ODS statement. Margins that are set using the TEMPLATE procedure definition are not honored. This behavior is by design.

The code below demonstrates how to set custom margins for ODS WORD output:

ods listing close;
options orientation=PORTRAIT leftmargin=0.75in rightmargin=0.75in topmargin=0.50in bottommargin=0.50in;
ods word file="test.docx" ;

proc report data=sashelp.cars nowd ;  
 where upcase(Origin)="USA" and Cylinders=6 ;
 column Make Model type Origin MSRP EngineSize Cylinders MPG_City MPG_Highway;
run;

ods word close;
ods listing;

Note: The ODS WORD destination is a preproduction feature with the SAS® 9.4M7 (TS1M7) release.