Published on :
Reporting SASHELP

Configure Paper Size and ODS RTF Export

This code is also available in: Deutsch Español Français
This script illustrates how to query the SAS© registry for available paper sizes, set the global PAPERSIZE option to A3, and generate an RTF file containing a simple report based on the SASHELP.PRDSALE table. Note: the file path 'c:\test.rtf' is Windows-specific and will need to be adapted for a Linux/Viya environment.
Data Analysis

Type : SASHELP


The data comes from the standard example table sashelp.prdsale.

1 Code Block
PROC REGISTRY
Explanation :
Displays the list of paper sizes defined in the SAS registry under the CORE\PRINTING\PAPER SIZES key.
Copied!
1 
2PROC REGISTRY list startat="CORE\PRINTING\PAPER SIZES";
3RUN;
4 
2 Code Block
OPTIONS
Explanation :
Sets the global paper size option to A3 for graphic and ODS outputs.
Copied!
1options papersize=a3;
3 Code Block
PROC PRINT
Explanation :
Opens the ODS RTF destination to a local file, generates a report from the sashelp.prdsale table, then closes the destination to finalize the file.
Copied!
1ods rtf file='c:\test.rtf' ;
2PROC PRINT DATA=sashelp.prdsale;
3RUN ;
4ods rtf close ;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.