Dear SAS users,
This is a small issue but has bugged me for a while. I am using SAS EG 8.3 to produce the simply produce a histogram. The previous SAS EG 7.1 was able to automatically produce the histogram (e.g.) when I run
proc univariate data=dat1 noprint;
histogram charlson;
run;
However, in SAS EG 8.3, the histogram was no longer automatically generated in the result. I tried to put ods graphics on and ods html, but it did not work.
Is there anything I should specifically set up in order for SAS EG 8.3 to automatically generate the plots/histograms?
What did the LOG show for the Proc univariate code when you had ODS Graphics on?
Nothing really.
I do not have SAS EG 8.3 so not sure if that is related. In a default installation of 8.2 code like yours runs and creates a histogram for a single variable.
You might try this.
ods graphics on; ods select histogram; proc univariate data=sashelp.class plots; var age; histogram; run;
The Select here replaces Noprint to suppress most of the output by selecting only the Histogram for output. The Plots statement seems to be needed to get an object named Histogram created, at least on my system based on SAS 9.4.7 . You didn't show how you "forced" html. I would try without that step first.
So this is what it showed after I run the proc univariate.
The histogram was not automatically displayed like EG 7.1 used to do -- this is after I specified ods graphics on.
What should I do? I felt this is a small issue but for some reasons I could not figure it out.
Are you using Enterprise Guide to execute some SAS code you wrote yourself?
Or are you clicking on something in Enterprise Guide that is generating the SAS code for you?
If the later can you get it to produce the histogram if you write the SAS code to produce the histogram?
That is, are you just asking what has changed in ENTERPRISE GUIDE that is causing it to generate different SAS code than it did before? Or are you asking what has changed in SAS to have it produce different output for the same SAS code? In the later case it will help for you to share what version of SAS ( not the front end Enterprise Guide tool) you are using in both cases.
Also can you produce other graphs besides these PROC UNIVARIATE histograms?
In 7.15, when you ran code, the results were generated in the Results tab, and by default automatically opened when generated. The option to display results was automatically selected which caused the results tab to display when you ran the code. If you deselect this, the results will be created, but the tab will remain in the background.
In 8.x and later, the results are displayed in the work area on the right side of the UI by default.
If I select the Results tab, I will see the histogram
If when you run your code, you do not see the Results tab, verify you have an ODS destination selected in the Tools->Options ->Results->General. The default is HTML with 8.x. If you do not have any result format selected, it will not display results in the Results tab. Also, Excel, PDF, Powerpoint, and RTF will generate links to the results since we don't open them inside Enterprise Guide
Also, there are some options that could help display your results by default in this window. In the Display Results section, check what you have Default tab to display. I set mine to Results so they display on top when I run the code. This is similar to the option in 7.15 that displayed results by default when generated.
Here is a link to the Working with results in the documentation:
https://go.documentation.sas.com/doc/en/egcdc/8.5/egdoccdc/egug/p0isi75859uecxn1equ6gvja5aqy.htm
I'm having a similar issue, except that I am using SAS EG 8.1 and I'm sure I have managed to create histograms before.
When I look in the results tab, I see a similar line of histogram related stuff (e.g. a header "Histogram for <var_name>, x-axis numbers, 0 5 10 15 20 Percent), but not the actual graph.
I'm typing the code in SAS EG 8.1, looks like this:
ods graphics on; ods select histogram; proc univariate data=my_data; var my_var; histogram; run;
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.