Skip to Content

Create PDF files for SAS output

Using the Output Delivery System (ODS), you can create PDF, rich text files (.rtf) and other file formats that contain output from your SAS programs. Determine the full path and filename to the folder where you want to write the file. Then by adding a couple commands to your program, SAS will create a file with that name in the desired format and write it to the specified folder. Here is a simple example:

ods pdf file=’c:/users/jwd/classdata.pdf’ style=pearl;

data one;
set sashelp.class;
run;
proc print;
run;

ods pdf close;

The first ods statement tells SAS to create a pdf file in my c:/users/jwd/ folder and name it classdata.pdf. The style option is added to modify how the file looks (fonts, color, etc.). A good one is style=pearl. The second ods statement closes the PDF file after proc print writes the contents of sashelp.class to it. After the program executes, the PDF file will open in a separate window.