I'm using PROC TABULATE to output a dataset and I don't want the TABULATE table to show in RTF or output i.e. I just want it to spit the dataset. Is there anyway to do that? looks like TABULATE has no NOPRINT equivalent
I'm using the code below and it doesn't serve the purpose...
ODS RTF file='PATH/.rtf'
ODS LISTING CLOSE;
proc tabulate data=DATA out=WANT;
class
tables Var , Var * (n pctn=''*f=pctfmt.) ;
run;
ODS LISTING;
ODS RTF CLSOE;
Thanks
Use the ODS Select statement
ods select none;
proc tabulate data=sashelp.class out=want;
class sex age;
tables sex age, n;
run;
ods select all;
Hi:
I don't know what you mean by "spit the dataset" -- you're going to need PROC PRINT for that -- there is no "spitting" to a destination without a procedure that creates output. I would suggest this instead. Move the TABULATE step outside of your ODS "sandwich" and then put your PROC PRINT "inside" the ODS statements.
Cynthia
ods listing;
** run tabulate and make the dataset work.want;
proc tabulate data=DATA out=WANT;
class
tables Var , Var * (n pctn=''*f=pctfmt.) ;
run;
ODS LISTING CLOSE;
ODS RTF file='PATH/.rtf'
proc print data=work.want;
run;
ODS RTF CLOSE;
Use the ODS Select statement
ods select none;
proc tabulate data=sashelp.class out=want;
class sex age;
tables sex age, n;
run;
ods select all;
Hello All,
Thank You very much for helping me through this type of output .
I have been working on text pad and as I use this tabulate I would get all the unwanted stuff .Any ways it was very much helpful.
Thanks a Lot.
Giridhar Goutham Y
With some languages "spit" (spitten nl) should be translated to dig (en), more advanced that is "data mining".
Sorry for the language, I meant for the proc tabulate to output the dataset I wanted without printing it in the rtf output. Cynthia, thanks for your suggestion; but I couldn't take the tabulate proc outside the ODS since it's inside a macro. I implemented Reeza's code and it works. Thank you all.
Hi:
You must be using some other code to get the dataset to appear in the RTF file. When I implement Reeza's code in this sample program, my RTF file is empty. See screen shot.
Cynthia
ods _all_ close;
ods rtf file='c:\temp\what_report.rtf';
ods select none;
proc tabulate data=sashelp.class out=want;
class sex age;
tables sex age, n;
run;
ods select all;
ods rtf close;
That's exactly what I wanted (for proc tabulate to do the tabulation, give me the dataset in the OUT= and not to print anything in the RTF; then I'm using the dataset for other calculation). I appreciate the response.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.