The SAS Output Delivery System and reporting techniques

NOPRINT for PROC TABULATE

Accepted Solution Solved
Reply
Contributor
Posts: 62
Accepted Solution

NOPRINT for PROC TABULATE

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


Accepted Solutions
Solution
‎05-14-2014 04:27 PM
Super User
Posts: 19,855

Re: NOPRINT for PROC TABULATE

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;

View solution in original post


All Replies
SAS Super FREQ
Posts: 8,868

Re: NOPRINT for PROC TABULATE


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;

Solution
‎05-14-2014 04:27 PM
Super User
Posts: 19,855

Re: NOPRINT for PROC TABULATE

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;

New Contributor
Posts: 3

Re: NOPRINT for PROC TABULATE

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

Trusted Advisor
Posts: 3,215

Re: NOPRINT for PROC TABULATE

With some languages "spit" (spitten nl) should be translated to dig (en),  more advanced that is "data mining".

---->-- ja karman --<-----
Contributor
Posts: 62

Re: NOPRINT for PROC TABULATE

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.

SAS Super FREQ
Posts: 8,868

Re: NOPRINT for PROC TABULATE

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;


empty_report.png
Contributor
Posts: 62

Re: NOPRINT for PROC TABULATE

Posted in reply to Cynthia_sas

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.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 8785 views
  • 8 likes
  • 5 in conversation