This is a basic question regarding saving ods output for later ods printing.
I would like to run a series of analysis procs and save the desired output. For example:
ods output CrossTabFreqs = _CrossTabFreqs;
proc freq data=mydata; tables X*Y; run;
ods output PearsonCorr = _PearsonCorr;
proc corr data=mydata; var X Y; with M N O; run;
ods fitplot = _fitplot;
proc reg data=mydata; model X = Y; run;
I now would like to create a pdf with the three selected ods output object in some order. For example:
ods pdf file="C:\mypdf.pdf";
*** what code goes here ***
*** so that I print the crossTab, pearson correlations and plot ***
ods pdf close;
I am using ods trace to obtain the default templates used for each output objects, but I don't know how to send those objects to the pdf destination.
Thanks for the help,
Look at PROC DOCUMENT, particularly the REPLAY statement.
Look at PROC DOCUMENT, particularly the REPLAY statement.
ods pdf file="C:\mypdf.pdf";
proc print data = _CrossTabFreqs;
run;
proc print data= _PearsonCorr;
run;
proc print data=_fitplot;
run;
ods pdf close;
If you want to make the plot, not print the data then use an appropriate graphing procedure.
OR possibly ODS select and just put all of the procedures in side the ODS sandwich.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.