BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
baroche64
Fluorite | Level 6
data Color;
   input Region Eyes $ Hair $ Count @@;
      label Eyes  ='Eye Color'
            Hair  ='Hair Color'
            Region='Geographic Region';
   datalines;
1 blue  fair   23  1 blue  red     7  1 blue  medium 24
1 blue  dark   11  1 green fair   19  1 green red     7
1 green medium 18  1 green dark   14  1 brown fair   34
1 brown red     5  1 brown medium 41  1 brown dark   40 
1 brown black   3  2 blue  fair   46  2 blue  red    21
2 blue  medium 44  2 blue  dark   40  2 blue  black   6
2 green fair   50  2 green red    31  2 green medium 37
2 green dark   23  2 brown fair   56  2 brown red    42
2 brown medium 53  2 brown dark   54  2 brown black  13
;

ods html style=statistical;
ods graphics on;

proc freq data=Color;
   tables Eyes Hair Eyes*Hair ;
   weight Count;
run;

ods graphics off;
ods html close;

The Code Above is not generating  any Graphics in SEG only tables. Please can anyone see what is wrong? The code was copied from the SAS website which shows examples of the charts produced by the same code, see here:

 

Frequency Bar Charts with PROC FREQ (sas.com)

 

 

The Log File, shows no errors:

 

1 The SAS System 09:59 Friday, May 26, 2023

1 ;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='Test Code';
4 %LET _CLIENTPROCESSFLOWNAME='Juriya Validated Farmers';
5 %LET _CLIENTPROJECTPATH='C:\DataAnalysis\KOBOWEB\SEG Projects\Analyse NAAS Farm Data\Analyse_JURIYA_FarmData_01.egp';
6 %LET _CLIENTPROJECTPATHHOST='PRECISION5470';
7 %LET _CLIENTPROJECTNAME='Analyse_JURIYA_FarmData_01.egp';
8 %LET _SASPROGRAMFILE='';
9 %LET _SASPROGRAMFILEHOST='';
10
11 ODS _ALL_ CLOSE;
12 OPTIONS DEV=PNG;
13 GOPTIONS XPIXELS=0 YPIXELS=0;
14 %macro HTML5AccessibleGraphSupported;
15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16 %mend;
17 FILENAME EGHTML TEMP;
18 ODS HTML5(ID=EGHTML) FILE=EGHTML
19 OPTIONS(BITMAP_MODE='INLINE')
20 %HTML5AccessibleGraphSupported
21 ENCODING='utf-8'
22 STYLE=HTMLBlue
23 NOGTITLE
24 NOGFOOTNOTE
25 GPATH=&sasworklocation
26 ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27
28 data Color;
29 input Region Eyes $ Hair $ Count @@;
30 label Eyes ='Eye Color'
31 Hair ='Hair Color'
32 Region='Geographic Region';
33 datalines;

NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.COLOR has 27 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds

43 ;
44
45 ods html style=statistical;
NOTE: Writing HTML Body file: sashtml12.htm
46 ods graphics on;
47
48 proc freq data=Color;
49 tables Eyes Hair Eyes*Hair ;
50 weight Count;
51 run;

NOTE: There were 27 observations read from the data set WORK.COLOR.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.14 seconds
cpu time 0.06 seconds

2 The SAS System 09:59 Friday, May 26, 2023


52
53 ods graphics off;
54 ods html close;
55
56 %LET _CLIENTTASKLABEL=;
57 %LET _CLIENTPROCESSFLOWNAME=;
58 %LET _CLIENTPROJECTPATH=;
59 %LET _CLIENTPROJECTPATHHOST=;
60 %LET _CLIENTPROJECTNAME=;
61 %LET _SASPROGRAMFILE=;
62 %LET _SASPROGRAMFILEHOST=;
63
64 ;*';*";*/;quit;run;
65 ODS _ALL_ CLOSE;
66
67
68 QUIT; RUN;
69

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You need to ask PROC FREQ to produce plots. Example:

 

   tables Eyes*Hair / plots=freqplot;
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

You need to ask PROC FREQ to produce plots. Example:

 

   tables Eyes*Hair / plots=freqplot;
--
Paige Miller
Ksharp
Super User
proc freq data=Color ;
tables Eyes Hair Eyes*Hair/ plots=all ;
weight Count;
run;
baroche64
Fluorite | Level 6

Thanks so much, this works as well.  

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1005 views
  • 2 likes
  • 3 in conversation