Hello mentors,
Following is my univariate procedure and I'm trying to create a histogram for the 1st time, but something is missing since instead of a graph, all I see is text with histogram values. ods default is html5, and output goes to the result window. Please help, what am I missing?
proc univariate data=abc;
var balance;
id id;
histogram balance/normal ;
inset skewness kurtosis/position=ne;
run;
O/P:
The UNIVARIATE Procedure
Log:
1 The SAS System 10:50 Friday, January 29, 2021
1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Program';
4 %LET _CLIENTPROCESSFLOWNAME='Process Flow';
5 %LET _CLIENTPROJECTPATH='aaa.egp';
6 %LET _CLIENTPROJECTPATHHOST='FB4B68626197A';
7 %LET _CLIENTPROJECTNAME='aaa.egp';
8 %LET _SASPROGRAMFILE='';
9 %LET _SASPROGRAMFILEHOST='';
10
11 ODS _ALL_ CLOSE;
12 OPTIONS DEV=SVG;
13 GOPTIONS XPIXELS=0 YPIXELS=0;
14 %macro HTML5AccessibleGraphSupported;
15 %if %_SAS_VERCOMP(9, 4, 4) >= 0 %then ACCESSIBLE_GRAPH;
16 %mend;
17 FILENAME EGHTML TEMP;
18 ODS HTML5(ID=EGHTML) FILE=EGHTML
19 OPTIONS(BITMAP_MODE='INLINE')
20 %HTML5AccessibleGraphSupported
MLOGIC(HTML5ACCESSIBLEGRAPHSUPPORTED): Beginning execution.
MLOGIC(_SAS_VERCOMP): Beginning execution.
MLOGIC(_SAS_VERCOMP): Parameter MAJOR has value 9
MLOGIC(_SAS_VERCOMP): Parameter MINOR has value 4
MLOGIC(_SAS_VERCOMP): Parameter MAINT has value 4
MLOGIC(_SAS_VERCOMP): %LOCAL CURMAJ
MLOGIC(_SAS_VERCOMP): %LOCAL CURMIN
MLOGIC(_SAS_VERCOMP): %LOCAL CURMNT
MLOGIC(_SAS_VERCOMP): %LET (variable name is CURMAJ)
SYMBOLGEN: Macro variable SYSVLONG resolves to A2
MLOGIC(_SAS_VERCOMP): %LET (variable name is CURMIN)
SYMBOLGEN: Macro variable SYSVLONG resolves to A3
MLOGIC(_SAS_VERCOMP): %LET (variable name is CURMNT)
SYMBOLGEN: Macro variable SYSVLONG resolves to A4
SYMBOLGEN: Macro variable MAJOR resolves to 9
SYMBOLGEN: Macro variable CURMAJ resolves to 9
MLOGIC(_SAS_VERCOMP): %IF condition %eval(&major NE &CurMaj) is FALSE
SYMBOLGEN: Macro variable MINOR resolves to 4
SYMBOLGEN: Macro variable CURMIN resolves to 04
MLOGIC(_SAS_VERCOMP): %IF condition %eval(&minor NE &CurMin) is FALSE
SYMBOLGEN: Macro variable MAINT resolves to 4
MLOGIC(_SAS_VERCOMP): %IF condition "&maint" = "" is FALSE
SYMBOLGEN: Macro variable CURMNT resolves to 6
SYMBOLGEN: Macro variable MAINT resolves to 4
MLOGIC(_SAS_VERCOMP): Ending execution.
MLOGIC(HTML5ACCESSIBLEGRAPHSUPPORTED): %IF condition %_SAS_VERCOMP(9, 4, 4) >= 0 is TRUE
MLOGIC(HTML5ACCESSIBLEGRAPHSUPPORTED): Ending execution.
21 ENCODING='utf-8'
22 STYLE=HtmlBlue
23 NOGTITLE
24 NOGFOOTNOTE
25 GPATH=&sasworklocation
SYMBOLGEN: Macro variable SASWORKLOCATION resolves to
"/saswork1/"
26 ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27
2 The SAS System 10:50 Friday, January 29, 2021
28 proc univariate data=abc;
29 var BALANCE;
30 id id;
31 histogram BALANCE/normal ;
32 inset skewness kurtosis/position=ne;
33 run;
NOTE: PROCEDURE UNIVARIATE used (Total process time):
real time 0.32 seconds
user cpu time 0.17 seconds
system cpu time 0.03 seconds
memory 7246.00k
OS Memory 44280.00k
Timestamp 01/29/2021 11:55:16 AM
Step Count 545 Switch Count 5
Page Faults 10
Page Reclaims 1635
Page Swaps 0
Voluntary Context Switches 239
Involuntary Context Switches 1
Block Input Operations 18648
Block Output Operations 328
34
35 %LET _CLIENTTASKLABEL=;
36 %LET _CLIENTPROCESSFLOWNAME=;
37 %LET _CLIENTPROJECTPATH=;
38 %LET _CLIENTPROJECTPATHHOST=;
39 %LET _CLIENTPROJECTNAME=;
40 %LET _SASPROGRAMFILE=;
41 %LET _SASPROGRAMFILEHOST=;
42
43 ;*';*";*/;quit;run;
44 ODS _ALL_ CLOSE;
45
46
47 QUIT; RUN;
48
Please post the complete SAS log.
Is that macro code something that you wrote, or is it coming from a SAS product (such as Enterprise Guide) in which you are running SAS?
I don't see anything obviously wrong, but it could be the data rather than the SAS syntax. Let's try two tests. The first test repeats your call to PROC UNIVARIATE on some data that we know is suitable for graphing. The second tries to create a histogram of your data by using PROC SGPOT. Let us know what happens when you submit these statements.
/* TEST 1: Is it the DATA? Can you see the histogram of this test data? */
data Have;
do id = 1 to 10;
BALANCE = rand("Normal");
output;
end;
run;
ods graphics on;
proc univariate data=Have;
var BALANCE;
id id;
histogram BALANCE/normal ;
inset skewness kurtosis/position=ne;
run;
/* TEST 2: Can you see the histogram created by PROC SGPLOT on the ABC data? */
proc sgplot data=abc;
histogram BALANCE;
density BALANCE;
run;
i checked my graph settings, and this is what it looks like:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.