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