/***************************************************************************************************************** SAS file name: Control_Output_Destination.sas File location: _________________________________________________________________________________________________________________ Purpose: To demonstrate the use of output destinations in SAS using ODS Author: Peter Clemmensen Creation Date: 17/15/2017 This program supports the blog post "Control Output Destination in SAS" on SASnrd.com *****************************************************************************************************************/ /* The default output destination since SAS 9.2 is HTML */ ods html; /* Open HTML destination for output */ proc sgplot data=sashelp.class; /* Run some procedure that creates an output */ scatter x=height y=weight; run; ods html close; /* Close the destination again */ /* Use both the HTML and PDF destinations */ ods html; /* Open HTML destination for output */ ods pdf; /* Open PDF destination for output */ proc print data=sashelp.class; /* This is outputted to HTML and PDF */ run; ods pdf close; /* Close PDF destination again */ proc sgplot data=sashelp.class; /* This is only outputted to HTML destination */ run; ods html close; /* Close the HTML destination again */ /* Save output to a file */ ods pdf file="MyPath.pdf"; /* Open PDF destination for output and specify FILE= option */ proc sgplot data=sashelp.class; /* Run some procedure that creates an output */ scatter x=height y=weight; run; ods pdf close; /* Close PDF destination again */ /* Display only latest procedure output */ ods pdf preferences; ods pdf close; ods pdf newfile=proc; proc sgplot data=sashelp.class; scatter x=height y=weight; run;