SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
SSH2
Obsidian | Level 7

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

2 REPLIES 2
ballardw
Super User

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.

 

Reeza
Super User

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


 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 1715 views
  • 0 likes
  • 3 in conversation