BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Stalk
Pyrite | Level 9

I specified datalabel option in my proc , still it's not showing up. How can I show data labels?

In see this message in my log..


WARNING: SASUSER.TEMPLAT is not a template store! It will be ignored.

WARNING: The bar labels are suppressed. Use BARLABELFITPOLICY=NONE to force the labels to be displayed.

proc sgplot data=all_reads PCTLEVEL=GRAPH;
styleattrs datacolors=(Red Blue) datacontrastcolors=(Red Blue);
vbarbasic Sample_name /transparency=.4 response = Total_Mean group=Replicate groupdisplay = cluster datalabel
nooutline Clusterwidth=0.8
stat=mean dataskin=gloss name='bar';
highlow x=Sample_name low=Low high=High / LINEATTRS=(COLOR=BLACK) group=replicate groupdisplay=cluster highcap=serif lowcap=serif ;
xaxis display=(nolabel noticks) discreteorder=data;
yaxis label="% Total Reads" ;
keylegend 'bar' /title='' noborder autooutline;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

For this case, you might want to pre-summarize the data and use a VBARPARM to render the bars and limits. In the simple example below, I had PROC SUMMARY compute the upper and lower CLM just to create data to demonstrate drawing the limits. All you need in your case the mean calculation:

 

proc summary data=sashelp.class nway;
class age;
var weight;
output out=calced mean=mean uclm=upper lclm=lower;
run;

proc sgplot data=calced;
vbarparm category=age response=mean / limitupper=upper limitlower=lower;
run;

View solution in original post

7 REPLIES 7
ballardw
Super User

Please do not copy error and warning messages separate from the code in the log. Position is important relative to code. Copy the text from the log including the procedure code and all the notes, warnings and messages. On the forum open a text box using the </> icon above the main message window and paste the text. The text box is important and the message windows on this forum will reformat text and may move diagnostic information that SAS often supplies as part of the log.

 

Your first "warning" is most likely to occur with PROC Template. You don't show any such and so can't discuss that.

 

 

 

Stalk
Pyrite | Level 9
NOTE: Analytical products:

      SAS/STAT 15.2
      SAS/ETS 15.2
      SAS/OR 15.2
      SAS/IML 15.2
      SAS/QC 15.2

NOTE: Additional host information:

 X64_10PRO WIN 10.0.19041  Workstation

NOTE: SAS initialization used:
      real time           2.84 seconds
      cpu time            2.43 seconds

NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: All profile changes will be lost at the end of the session.
WARNING: SASUSER.TEMPLAT is not a template store! It will be ignored.
NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.
NOTE: All profile changes will be lost at the end of the session.




Stalk
Pyrite | Level 9

Also my Standard deviation bars are not showing up in the center..

Stalk_0-1702069437296.png

 

ballardw
Super User

Does not show any code from Proc SGPLOT  or the messages.

 

That about SASUSER.Profile is typical when you have two (or more) active display  manager sessions running. If that is the case then close the extras.

Stalk
Pyrite | Level 9
53
54   title1 " Percent Total Read ";
55   ods listing style=listing gpath="c:\temp\Graphs\";
56
57   ods graphics / width=8in height=2.81in;
58   ods graphics / reset=ALL outputfmt=PNG imagename="Total_Read_Mean_std";
59   
60   
61
62   proc sgplot data=all_reads PCTLEVEL=GRAPH;
63   styleattrs datacolors=(Red Blue) datacontrastcolors=(Red Blue);
64   vbarbasic Sample_name  /transparency=.4 response =  Total_Read_Mean  group=Replicate  groupdisplay = cluster
64 ! datalabel
65    nooutline Clusterwidth=0.8 Barwidth=1
66       stat=mean dataskin=gloss name='bar';
67     highlow x=Sample_name low=Low high=High / LINEATTRS=(COLOR=BLACK) group=replicate groupdisplay=cluster
67 ! highcap=serif lowcap=serif ;
68     xaxis display=(nolabel noticks) discreteorder=data;
69     yaxis label="% Total  Reads" ;
70   keylegend 'bar' /title='' noborder autooutline;
71   run;

NOTE: Writing HTML Body file: sashtml.htm
WARNING: SASUSER.TEMPLAT is not a template store! It will be ignored.
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           9.77 seconds
      cpu time            3.61 seconds

WARNING: The bar labels are suppressed. Use BARLABELFITPOLICY=NONE to force the labels to be displayed.
WARNING: The bar labels are suppressed. Use BARLABELFITPOLICY=NONE to force the labels to be displayed.
NOTE: Listing image output written to c:\temp\Graphs\Total_Read_Mean_std.png.
NOTE: There were 96 observations read from the data set WORK.ALL_READS.
DanH_sas
SAS Super FREQ

For this case, you might want to pre-summarize the data and use a VBARPARM to render the bars and limits. In the simple example below, I had PROC SUMMARY compute the upper and lower CLM just to create data to demonstrate drawing the limits. All you need in your case the mean calculation:

 

proc summary data=sashelp.class nway;
class age;
var weight;
output out=calced mean=mean uclm=upper lclm=lower;
run;

proc sgplot data=calced;
vbarparm category=age response=mean / limitupper=upper limitlower=lower;
run;
Stalk
Pyrite | Level 9
Actually, I had 48 bars, so the graph was crowded. Increasing the size of the graph fixed the data labels and centered the std error bar on the top. ods graphics / reset=ALL outputfmt=PNG imagename="GC_All." width=12IN height=12IN;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1140 views
  • 2 likes
  • 3 in conversation