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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: