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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.