BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robertrao
Quartz | Level 8

Hi,

I want to generate a Histogam in the Univariate procedure and I get this warning

"WARNING: ODS Graphics is experimental in this release of the UNIVARIATE procedure."

Can anyone help me get the Histogram in the pdf format.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The warning is there because behavior of the options related to the procedure could change in future releases.

The generate PDF output use

ODS PDF file="path and file name you want.pdf" ; /* there are other options but this is minimal*/

/* your univariate or other output code goes here*/

ods pdf close;

View solution in original post

9 REPLIES 9
ballardw
Super User

The warning is there because behavior of the options related to the procedure could change in future releases.

The generate PDF output use

ODS PDF file="path and file name you want.pdf" ; /* there are other options but this is minimal*/

/* your univariate or other output code goes here*/

ods pdf close;

robertrao
Quartz | Level 8

Thank you so very much for the answer. This forum is very useful. I had to use all of the following too..

ods trace on;

ods exclude  Moments BasicMeasures TestsForLocation Quantiles ExtremeObs;

ods pdf file="C:\Data\abc.pdf";

Is there any direct way to get only the Histogram in our PDF. If I dint do the ods exclude I get 3 pages and my interest is onlt the histogram.

Could not use ods INCLUDE. It says the file name is not correct!!so i went the round way

Reeza
Super User

use no print in your univariate procedure:

options nodate nonumber;

ods pdf file='C:\temp\example.pdf' notoc;

proc univariate data=sashelp.class NOPRINT;

     histogram height;

run;

ods pdf close;

robertrao
Quartz | Level 8

Also on the X-axis I get variable label(Average_cost_per_Gallon). What do I have to do to Rename that label to something else (Average Cost per Gallon)

Thanks in Advance

Reeza
Super User

Add a label to your variable ie

label average_cost_per_gallon='Average Cost per Gallon';

Rick_SAS
SAS Super FREQ

The opposite of EXCLUDE is SELECT, not "include." Thus you can say

ODS SELECT Histogram;

Reeza
Super User

That doesn't work for me Rick:

598  ods select Histogram;

599  proc univariate data=sashelp.class;

600  var height;

601  histogram height;

602  run;

WARNING: Output 'Histogram' was not created.  Make sure that the output object name, label, or path is spelled

         correctly.  Also, verify that the appropriate procedure options are used to produce the requested output

         object.  For example, verify that the NOPRINT option is not used.

NOTE: PROCEDURE UNIVARIATE used (Total process time):

      real time           1.45 seconds

      cpu time            0.11 seconds

Rick_SAS
SAS Super FREQ

It works provided that ODS graphics are enabled.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 3689 views
  • 3 likes
  • 4 in conversation