I want to suppress the tables that the HISTOGRAM statement creates.I used the NOPRINT option in the HISTOGRAM statement, but it does not work, error happened.
For example, my code is:
proc univariate data=data noprint;
histogram teg_alpha_angle teg_r_time / noprint;
run;
Log information:
proc univariate data=data noprint;
69 histogram teg_alpha_angle teg_r_time / noprint;
-------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ANNOKEY, ANNOTATE, BARLABEL,
BARWIDTH, BETA, CAXIS, CBARLINE, CFILL, CFRAME, CFRAMESIDE, CFRAMETOP, CGRID,
CHREF, CLIPREF, CONTENTS, CPROP, CTEXT, CV, CVREF, DESCRIPTION, ENDPOINTS,
EXPONENTIAL, FONT, FRONTREF, GAMMA, GRID, GUMBEL, HANGING, HAXIS, HEIGHT, HMINOR,
HOFFSET, HREF, HREFLABELS, HREFLABPOS, IGAUSS, INFONT, INHEIGHT, INTERBAR,
INTERTILE, KERNEL, LGRID, LHREF, LOGNORMAL, LVREF, MAXNBIN, MAXSIGMAS,
MIDPERCENTS, MIDPOINTS, NAME, NCOL, NCOLS, NENDPOINTS, NMIDPOINTS, NOBARS,
NOCHART, NOCURVELEGEND, NOFRAME, NOHLABEL, NOLEGEND, NOPLOT, NORMAL,
NOTABCONTENTS, NOVLABEL, NOVTICK, NROW, NROWS, OUTHISTOGRAM, OUTKERNEL, PARETO,
PFILL, POWER, RAYLEIGH, RTINCLUDE, SB, SU, TILELEGLABEL, TURNVLABELS, VAXIS,
VAXISLABEL, VMINOR, VOFFSET, VREF, VREFLABELS, VREFLABPOS, VSCALE, WAXIS,
WBARLINE, WEIBULL, WGRID.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
70 run;
How to solve this problem?? Thanks in advance~
It really really really helps if you post that in the first place.
Use ODS SELECT to keep only the histogram.
ods select Histogram;
proc univariate data=sashelp.class noprint;
histogram weight height / normal;
run;
Noprint on the proc statement usually means that ODS output, such as histograms are suppressed. Only use the option on the HISTOGRAM statement.
It still does not work....
code:
proc univariate data=data;
histogram alpha_angle/ noprint;
run;
Log:
87 proc univariate data=data;
88 histogram alpha_angle/ noprint;
-------
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ANNOKEY, ANNOTATE, BARLABEL,
BARWIDTH, BETA, CAXIS, CBARLINE, CFILL, CFRAME, CFRAMESIDE, CFRAMETOP, CGRID,
CHREF, CLIPREF, CONTENTS, CPROP, CTEXT, CV, CVREF, DESCRIPTION, ENDPOINTS,
EXPONENTIAL, FONT, FRONTREF, GAMMA, GRID, GUMBEL, HANGING, HAXIS, HEIGHT, HMINOR,
HOFFSET, HREF, HREFLABELS, HREFLABPOS, IGAUSS, INFONT, INHEIGHT, INTERBAR,
INTERTILE, KERNEL, LGRID, LHREF, LOGNORMAL, LVREF, MAXNBIN, MAXSIGMAS,
MIDPERCENTS, MIDPOINTS, NAME, NCOL, NCOLS, NENDPOINTS, NMIDPOINTS, NOBARS,
NOCHART, NOCURVELEGEND, NOFRAME, NOHLABEL, NOLEGEND, NOPLOT, NORMAL,
NOTABCONTENTS, NOVLABEL, NOVTICK, NROW, NROWS, OUTHISTOGRAM, OUTKERNEL, PARETO,
PFILL, POWER, RAYLEIGH, RTINCLUDE, SB, SU, TILELEGLABEL, TURNVLABELS, VAXIS,
VAXISLABEL, VMINOR, VOFFSET, VREF, VREFLABELS, VREFLABPOS, VSCALE, WAXIS,
WBARLINE, WEIBULL, WGRID.
ERROR 202-322: The option or parameter is not recognized and will be ignored.
89 run;
Probably time to use a different procedure such as Prog SGPLOt
Thanks for your suggestion.
But, in proc sgplot, it seems like each histogram statement can only has one variable, right?
Anyway, thanks~
What version of SAS are you on? I'm on SAS 9.3
This worked for me with no errors and no extra tables:
proc univariate data=sashelp.class noprint;
histogram weight height;
run;
I am on SAS 9.3 too. This works for me too. But if you add normal option after histogram statement, estimates tables will come out again....I want to suppress those tables.....
You can try:
proc univariate data=sashelp.class noprint;
histogram weight height / normal;
run;
Consider using the ODS EXCLUDE statement to suppress the tables you don't want to see. Use ODS TRACE to determine the table names.
Thanks a lot~
It really really really helps if you post that in the first place.
Use ODS SELECT to keep only the histogram.
ods select Histogram;
proc univariate data=sashelp.class noprint;
histogram weight height / normal;
run;
Awesome!! It really works!
Thank you very much!!!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.