Published on :
Reporting SASHELP

ODS RTF Report Generation

This code is also available in: Deutsch Español Français
The script initializes macro variables for the output format (RTF) and the number of columns. It then opens an ODS RTF destination, configures graphics options for landscape orientation, and uses PROC PRINT to display the 'region', 'stores', and 'sales' variables from the 'sashelp.shoes' dataset. Finally, it closes the ODS destination.
Data Analysis

Type : SASHELP


The script uses the 'sashelp.shoes' dataset, which is a built-in SAS data library.

1 Code Block
PROC PRINT
Explanation :
This block configures the ODS (Output Delivery System) to generate an RTF ('Rich Text Format') file. The macro variables `dest` and `cols` are used to define the format and the number of columns. Graphics options ('goptions') are set for landscape presentation. The `PROC PRINT` procedure is then used to display the 'region', 'stores', and 'sales' variables from the 'sashelp.shoes' dataset. Finally, the ODS destination is closed.
Copied!
1%let dest=rtf; * pdf, ps or rtf ;
2%let cols=2 ;
3ods &dest columns=&cols file="c:\test.&dest" ;
4goptions rotate=landscape ;
5PROC PRINT DATA=sashelp.shoes ;
6 var region stores sales ;
7RUN ;
8ods &dest 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.