DATA Step, Macro, Functions and more

save several proc freq and proc contents table output

Reply
Occasional Contributor
Posts: 12

save several proc freq and proc contents table output

Is there any way I can save several proc freq and proc contents output tables together (like an log file)?  For example:

 

proc freq data=a; table b c; run;

proc freq data=a1; table b1 c1; run;

proc contents data=a3; run;

 

I would like to open the saved tables in SAS. Like open an saved log file?  Thank you

Super User
Posts: 13,889

Re: save several proc freq and proc contents table output

I would suggest creating document such as RTF or PDF using ods.

 

ods rtf file='c:\path\myoutput.rtf';

proc freq data=a; table b c; run;

proc freq data=a1; table b1 c1; run;

proc contents data=a3; run;

ods rtf close;

While those procedures can create output data sets and they could be combined the result would be ugly at best and practically unusable for almost anything. The above code creates a document that most word processors can open for your reading enjoyment. Change the  path and file name to what ever you want.

 

Super User
Posts: 23,958

Re: save several proc freq and proc contents table output

You have several output options, within SAS and outside.

You can use ODS to have the results sent to PDF, RTF (word), XLSX, PPTX, HTML and some other options.

 

Or you can capture the data into tables and use those. 

 

If you're looking for the latter, use the OUT= on the TABLE statement and PROC CONTENTS. 

 

If the first, then use something like the following:

 

ods pdf file='path to file.pdf';


Your sas code goes here;


ods pdf close;

@SSH2 wrote:

Is there any way I can save several proc freq and proc contents output tables together (like an log file)?  For example:

 

proc freq data=a; table b c; run;

proc freq data=a1; table b1 c1; run;

proc contents data=a3; run;

 

I would like to open the saved tables in SAS. Like open an saved log file?  Thank you


 

Ask a Question
Discussion stats
  • 2 replies
  • 88 views
  • 0 likes
  • 3 in conversation