Hello
I want to create a data set called nlev_all that contain formation of number of missing observations.
The data set was created and it is 100% fine.
The problem is that I don't want to print it.
What is the way to prevent print of data set nlev_all?
ods output nlevels=work.nlev_all;
proc freq data=sashelp.shoes nlevels;
tables _all_ /noprint;
run;
You have to tell PROC FREQ to write something in order to ODS OUTPUT to have something to write to the dataset.
So you just need to suppress any other active ODS destinations from displaying the output also.
Use ODS SELECT statements.
ods select none;
ods output nlevels=nlevels;
proc freq data=sashelp.class nlevels;
tables _all_ / noprint;
run;
ods select all;
proc print data=nlevels;
run;
Looking at the docs of proc freq, it seems an option exists preventing all printed output.
I looked and haven't seen the solution, this is the reason that I ask here
If your print is going to HTML, try
ods html select none;
Is it not HTML in the results window? Have you opened some other destination for output?
@Ronein wrote:
I am trying to apply your answer but get error
You have been in the forum for many years now. You should know that when you get an error, you should show us _____________
Please show that to us. Don't make us ask, just do it every single time.
The following table is displayed on https://documentation.sas.com/doc/de/pgmsascdc/9.4_3.5/procstat/procstat_freq_syntax01.htm
This is not the answer since NOPRINT option prevent the print of the frequency table but don't prevent the print of NLEVELS table
@Ronein wrote:
Hello
I want to create a data set called nlev_all that contain formation of number of missing observations.
The data set was created and it is 100% fine.
The problem is that I don't want to print it.
What is the way to prevent print of data set nlev_all?
ods output nlevels=work.nlev_all;
proc freq data=sashelp.shoes nlevels;
tables _all_ /noprint;
run;
I am afraid that anything that is suppressed in the ODS results will not populate a data set created with ODS OUTPUT. The ODS output uses only information sent to an ods destination. If you do not want something to appear in a report document then create the data set outside of the ODS sandwich that defines the start/end of the output document and then use the data set created as needed.
Dummy code example:
ods output nlevels=work.nlev_all; proc freq data=sashelp.shoes nlevels; tables _all_/noprint; run; ods rtf file='<path to report file>\reportdocumentname.rtf'; proc print work.nlev_all <print options> run; ods rtf close;
You have to tell PROC FREQ to write something in order to ODS OUTPUT to have something to write to the dataset.
So you just need to suppress any other active ODS destinations from displaying the output also.
Use ODS SELECT statements.
ods select none;
ods output nlevels=nlevels;
proc freq data=sashelp.class nlevels;
tables _all_ / noprint;
run;
ods select all;
proc print data=nlevels;
run;
https://blogs.sas.com/content/iml/2015/05/26/suppress-ods.html
ods select none;
ods output nlevels=work.nlev_all;
proc freq data=sashelp.shoes nlevels;
tables _all_ /noprint;
run;
ods select all;
@Ronein wrote:
Hello
I want to create a data set called nlev_all that contain formation of number of missing observations.
The data set was created and it is 100% fine.
The problem is that I don't want to print it.
What is the way to prevent print of data set nlev_all?
ods output nlevels=work.nlev_all;
proc freq data=sashelp.shoes nlevels;
tables _all_ /noprint;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.