BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KAZ
Obsidian | Level 7 KAZ
Obsidian | Level 7

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,

1 ACCEPTED SOLUTION

Accepted Solutions
Tim_SAS
Barite | Level 11

Look at PROC DOCUMENT, particularly the REPLAY statement.

View solution in original post

2 REPLIES 2
Tim_SAS
Barite | Level 11

Look at PROC DOCUMENT, particularly the REPLAY statement.

ballardw
Super User
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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1138 views
  • 1 like
  • 3 in conversation