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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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