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!
%let dest=rtf; * pdf, ps or rtf ;
%let cols=2 ;
ods &dest columns=&cols file="c:\test.&dest" ;
goptions rotate=landscape ;
proc print data=sashelp.shoes ;
var region stores sales ;
run ;
ods &dest close ;
1
%let dest=rtf; * pdf, ps or rtf ;
2
%let cols=2 ;
3
ods &dest columns=&cols file="c:\test.&dest" ;
4
goptions rotate=landscape ;
5
PROC PRINTDATA=sashelp.shoes ;
6
var region stores sales ;
7
RUN ;
8
ods &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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.