<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: prevent print in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970654#M377127</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I just want to use the output data set and I dont need the print on screen&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just repeating what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;already shared:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prevent the printing of what exactly?&lt;/P&gt;
&lt;P&gt;If you just want to prevent the frequencies from printing just use the normal PROC FREQ options for that, no need to delve into how ODS works.&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;tables _all_ / noprint;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 13 Jul 2025 02:18:00 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2025-07-13T02:18:00Z</dc:date>
    <item>
      <title>prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970640#M377119</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;What is the way to prevent print ?&lt;/P&gt;
&lt;P&gt;i tried ODS close but it didnt work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.cars  nlevels;
ods       exclude onewayfreqs;
ods       output
nlevels= want
(keep  =  tablevar nlevels NNonMissLevels NMissLevels
rename = (tablevar=VAR_NAME  nlevels=n_levels));
Run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 12 Jul 2025 05:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970640#M377119</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-07-12T05:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970643#M377120</link>
      <description>Maxim 1: Read the Documentation!&lt;BR /&gt;ODS _ALL_ CLOSE;</description>
      <pubDate>Sat, 12 Jul 2025 08:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970643#M377120</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-07-12T08:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970645#M377122</link>
      <description>&lt;P&gt;Prevent the printing of what exactly?&lt;/P&gt;
&lt;P&gt;If you just want to prevent the frequencies from printing just use the normal PROC FREQ options for that, no need to delve into how ODS works.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tables _all_ / noprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to exclude the ODS output NLEVELS then say so in the ODS EXCLUDE statement.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    ods exclude nlevels ;
2    ods output nlevels= want
3      (keep= tablevar nlevels NNonMissLevels NMissLevels
4       rename=(tablevar=VAR_NAME  nlevels=n_levels)
5      )
6    ;
7
8    proc freq data=sashelp.class nlevels;
9     tables _all_ / noprint;
10   run;

NOTE: The data set WORK.WANT has 5 observations and 4 variables.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;If you want to exclude all output use the special ODS keyword ALL.&amp;nbsp; But make sure to reverse it by adding ODS EXCLUDE NONE when finished with the block of code that needs everything excluded.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods exclude all;
ods output nlevels= want
  (keep= tablevar nlevels NNonMissLevels NMissLevels
   rename=(tablevar=VAR_NAME  nlevels=n_levels)
  )
;

proc freq data=sashelp.cars  nlevels;
run;

ods exclude none;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log&lt;/P&gt;
&lt;PRE&gt;1    ods exclude all;
2    ods output nlevels= want
3      (keep= tablevar nlevels NNonMissLevels NMissLevels
4       rename=(tablevar=VAR_NAME  nlevels=n_levels)
5      )
6    ;
7
8    proc freq data=sashelp.cars  nlevels;
9    run;

NOTE: The data set WORK.WANT has 15 observations and 4 variables.
NOTE: There were 428 observations read from the data set SASHELP.CARS.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


10
11   ods exclude none;
12
13   proc print data=want;
14   run;

NOTE: There were 15 observations read from the data set WORK.WANT.
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jul 2025 15:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970645#M377122</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-12T15:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970646#M377123</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;What is the way to prevent print ?&lt;/P&gt;
&lt;P&gt;i tried ODS close but it didnt work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=sashelp.cars  nlevels;
ods       exclude onewayfreqs;
ods       output
nlevels= want
(keep  =  tablevar nlevels NNonMissLevels NMissLevels
rename = (tablevar=VAR_NAME  nlevels=n_levels));
Run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you close ALL the ODS destinations then the ODS OUTPUT is likely not going to do anything as the there is not going to be any ODS output generated. As I understand it the ODS OUTPUT captures what is sent to the ODS destination into data set(s).&lt;/P&gt;
&lt;P&gt;If you don't want the Nlevels ODS output to appear in your default ODS destination you would have to close the ODS and then direct the output to a different ODS destination, such as a document you then ignore.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it may help to describe more of what you are attempting to accomplish overall instead of just one bit.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jul 2025 14:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970646#M377123</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-07-12T14:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970648#M377125</link>
      <description>I just want to use the output data set and I dont need the print on screen</description>
      <pubDate>Sat, 12 Jul 2025 15:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970648#M377125</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2025-07-12T15:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970654#M377127</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I just want to use the output data set and I dont need the print on screen&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just repeating what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;already shared:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Prevent the printing of what exactly?&lt;/P&gt;
&lt;P&gt;If you just want to prevent the frequencies from printing just use the normal PROC FREQ options for that, no need to delve into how ODS works.&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;tables _all_ / noprint;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Jul 2025 02:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970654#M377127</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2025-07-13T02:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970657#M377128</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I just want to use the output data set and I dont need the print on screen&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Repeat:&lt;/P&gt;
&lt;P&gt;If you don't want the PROC FREQ Nlevels ODS output to appear in your default ODS destination you would have to close the ODS and then direct the output to a different ODS destination, such as a document you then ignore. Then close that and restart another ODS destination for your "screen".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With Proc Document you could&amp;nbsp; compile the "desired" screen output elements into another document if that is the objection to the "screen" appearance of the Nlevels output from Proc Freq.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There may be other ways to get what you want in the data set but I guarantee it will take a lot more programming.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jul 2025 08:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970657#M377128</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-07-13T08:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970658#M377129</link>
      <description>Issue the ODS _ALL_ CLOSE immediately before ODS OUTPUT.</description>
      <pubDate>Sun, 13 Jul 2025 09:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970658#M377129</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2025-07-13T09:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: prevent print</title>
      <link>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970664#M377131</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Issue the ODS _ALL_ CLOSE immediately before ODS OUTPUT.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No need to be that drastic.&amp;nbsp; Closing all of the ods outputs can cause havoc with environments like SAS/Studio that like to try and control the SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead you can just EXCLUDE the outputs you don't want printed.&lt;/P&gt;
&lt;PRE&gt;1    ods exclude nlevels;
2    ods output nlevels=want;
3    proc freq data=sashelp.class nlevels;
4      tables _all_ / noprint;
5    run;

NOTE: The data set WORK.WANT has 5 observations and 4 variables.
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: PROCEDURE FREQ used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Jul 2025 14:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/prevent-print/m-p/970664#M377131</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-07-13T14:13:43Z</dc:date>
    </item>
  </channel>
</rss>

