<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Formatting datalabels without overriding value label formats in SGPLOT in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Formatting-datalabels-without-overriding-value-label-formats-in/m-p/508465#M1659</link>
    <description>&lt;P&gt;Hi, fellow SAS users-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First-time poster, here, so please give tips/observations on how to improve posts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create&amp;nbsp;a dot plot in which the dots have data labels to two decimal places and the x-axis value labels follow a format that I've predefined.&amp;nbsp; I can't seem to get both at the same time, however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some lines of code that assign the following labels to the values 0-3 of the variable "assess":&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC FORMAT;
	value assess 0 = "Strongly Disagree" 1 = "Disagree" 2 = "Agree" 3 = "Strongly Agree";
RUN;&lt;/PRE&gt;&lt;P&gt;Later in the code, I create a data set with the variable "assess", limiting it to two decimals.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA coal_long2;
	MERGE coal_long formerge;
	BY Coalition;
	format assess d4.2;
RUN;	&lt;/PRE&gt;&lt;P&gt;When I create the dot plot using this code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*Dot Chart*/
/*Figure 1:  Mean Self-Assessment by Coalition*/
ods listing style=listing;
ods listing gpath="H:\Coalitions\";
ods graphics on / imagename="figure1a";
ods graphics / width=8in height=7in;
PROC SGPLOT data=coal_long2;
	format Coalition Coalition. assess assess.;
	dot Coalition / response=assess stat=mean datalabel limitstat=clm; 
	title "Figure 1. Mean Self-Assessment (By Coalition)";
RUN;
ods graphics off;&lt;/PRE&gt;&lt;P&gt;I get this chart, with value labels on the x-axis, but data labels to many decimal points:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="figure1a21.png" style="width: 463px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24462i514B0A25F43CD4A3/image-dimensions/463x405?v=v2" width="463" height="405" role="button" title="figure1a21.png" alt="figure1a21.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the other hand, when I remove the argument that applies the value labels ("assess assess."), with this code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*Dot Chart*/
/*Figure 1:  Mean Self-Assessment by Coalition*/
ods listing style=listing;
ods listing gpath="H:\Coalitions\";
ods graphics on / imagename="figure1a";
ods graphics / width=8in height=7in;
PROC SGPLOT data=coal_long2;
	format Coalition Coalition.;
	dot Coalition / response=assess stat=mean datalabel limitstat=clm; 
	title "Figure 1. Mean Self-Assessment (By Coalition)";
RUN;
ods graphics off;&lt;BR /&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get data labels to two decimals, but no value labels.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="figure1a23.png" style="width: 443px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24463i26BB926F67EA8F54/image-dimensions/443x388?v=v2" width="443" height="388" role="button" title="figure1a23.png" alt="figure1a23.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm clearly not understanding SAS's formatting procedures; there's something I'm missing "upstream," but I can't figure out what it is.&amp;nbsp; Could someone throw me a bone, here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
    <pubDate>Mon, 29 Oct 2018 19:05:47 GMT</pubDate>
    <dc:creator>dbcrow</dc:creator>
    <dc:date>2018-10-29T19:05:47Z</dc:date>
    <item>
      <title>Formatting datalabels without overriding value label formats in SGPLOT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-datalabels-without-overriding-value-label-formats-in/m-p/508465#M1659</link>
      <description>&lt;P&gt;Hi, fellow SAS users-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First-time poster, here, so please give tips/observations on how to improve posts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create&amp;nbsp;a dot plot in which the dots have data labels to two decimal places and the x-axis value labels follow a format that I've predefined.&amp;nbsp; I can't seem to get both at the same time, however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some lines of code that assign the following labels to the values 0-3 of the variable "assess":&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC FORMAT;
	value assess 0 = "Strongly Disagree" 1 = "Disagree" 2 = "Agree" 3 = "Strongly Agree";
RUN;&lt;/PRE&gt;&lt;P&gt;Later in the code, I create a data set with the variable "assess", limiting it to two decimals.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA coal_long2;
	MERGE coal_long formerge;
	BY Coalition;
	format assess d4.2;
RUN;	&lt;/PRE&gt;&lt;P&gt;When I create the dot plot using this code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*Dot Chart*/
/*Figure 1:  Mean Self-Assessment by Coalition*/
ods listing style=listing;
ods listing gpath="H:\Coalitions\";
ods graphics on / imagename="figure1a";
ods graphics / width=8in height=7in;
PROC SGPLOT data=coal_long2;
	format Coalition Coalition. assess assess.;
	dot Coalition / response=assess stat=mean datalabel limitstat=clm; 
	title "Figure 1. Mean Self-Assessment (By Coalition)";
RUN;
ods graphics off;&lt;/PRE&gt;&lt;P&gt;I get this chart, with value labels on the x-axis, but data labels to many decimal points:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="figure1a21.png" style="width: 463px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24462i514B0A25F43CD4A3/image-dimensions/463x405?v=v2" width="463" height="405" role="button" title="figure1a21.png" alt="figure1a21.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the other hand, when I remove the argument that applies the value labels ("assess assess."), with this code:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/*Dot Chart*/
/*Figure 1:  Mean Self-Assessment by Coalition*/
ods listing style=listing;
ods listing gpath="H:\Coalitions\";
ods graphics on / imagename="figure1a";
ods graphics / width=8in height=7in;
PROC SGPLOT data=coal_long2;
	format Coalition Coalition.;
	dot Coalition / response=assess stat=mean datalabel limitstat=clm; 
	title "Figure 1. Mean Self-Assessment (By Coalition)";
RUN;
ods graphics off;&lt;BR /&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get data labels to two decimals, but no value labels.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="figure1a23.png" style="width: 443px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24463i26BB926F67EA8F54/image-dimensions/443x388?v=v2" width="443" height="388" role="button" title="figure1a23.png" alt="figure1a23.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm clearly not understanding SAS's formatting procedures; there's something I'm missing "upstream," but I can't figure out what it is.&amp;nbsp; Could someone throw me a bone, here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 19:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-datalabels-without-overriding-value-label-formats-in/m-p/508465#M1659</guid>
      <dc:creator>dbcrow</dc:creator>
      <dc:date>2018-10-29T19:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting datalabels without overriding value label formats in SGPLOT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-datalabels-without-overriding-value-label-formats-in/m-p/508499#M1662</link>
      <description>&lt;P&gt;You can assign a different variable as the datalabel, so use two variables here, that are essentially identical.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Format the one for the datalabel using 8.2 and then format the one with the format required for the axis.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DATA coal_long2;
	MERGE coal_long formerge;
	BY Coalition;

&lt;FONT color="#800080"&gt;&lt;STRONG&gt;dl = assess;

format assess assess.;
format dl F8.2;&lt;/STRONG&gt;&lt;/FONT&gt;

RUN;	


/*Dot Chart*/
/*Figure 1:  Mean Self-Assessment by Coalition*/
ods listing style=listing;
ods listing gpath="H:\Coalitions\";
ods graphics on / imagename="figure1a";
ods graphics / width=8in height=7in;
PROC SGPLOT data=coal_long2;
	format Coalition Coalition. assess assess.;
	dot Coalition / response=assess stat=mean &lt;FONT color="#800080"&gt;&lt;STRONG&gt;datalabel=dl&lt;/STRONG&gt;&lt;/FONT&gt; limitstat=clm; 
	title "Figure 1. Mean Self-Assessment (By Coalition)";
RUN;
ods graphics off;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/241468"&gt;@dbcrow&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, fellow SAS users-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First-time poster, here, so please give tips/observations on how to improve posts.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create&amp;nbsp;a dot plot in which the dots have data labels to two decimal places and the x-axis value labels follow a format that I've predefined.&amp;nbsp; I can't seem to get both at the same time, however.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have some lines of code that assign the following labels to the values 0-3 of the variable "assess":&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;PROC FORMAT;
	value assess 0 = "Strongly Disagree" 1 = "Disagree" 2 = "Agree" 3 = "Strongly Agree";
RUN;&lt;/PRE&gt;
&lt;P&gt;Later in the code, I create a data set with the variable "assess", limiting it to two decimals.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DATA coal_long2;
	MERGE coal_long formerge;
	BY Coalition;
	format assess d4.2;
RUN;	&lt;/PRE&gt;
&lt;P&gt;When I create the dot plot using this code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*Dot Chart*/
/*Figure 1:  Mean Self-Assessment by Coalition*/
ods listing style=listing;
ods listing gpath="H:\Coalitions\";
ods graphics on / imagename="figure1a";
ods graphics / width=8in height=7in;
PROC SGPLOT data=coal_long2;
	format Coalition Coalition. assess assess.;
	dot Coalition / response=assess stat=mean datalabel limitstat=clm; 
	title "Figure 1. Mean Self-Assessment (By Coalition)";
RUN;
ods graphics off;&lt;/PRE&gt;
&lt;P&gt;I get this chart, with value labels on the x-axis, but data labels to many decimal points:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="figure1a21.png" style="width: 463px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24462i514B0A25F43CD4A3/image-dimensions/463x405?v=v2" width="463" height="405" role="button" title="figure1a21.png" alt="figure1a21.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the other hand, when I remove the argument that applies the value labels ("assess assess."), with this code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*Dot Chart*/
/*Figure 1:  Mean Self-Assessment by Coalition*/
ods listing style=listing;
ods listing gpath="H:\Coalitions\";
ods graphics on / imagename="figure1a";
ods graphics / width=8in height=7in;
PROC SGPLOT data=coal_long2;
	format Coalition Coalition.;
	dot Coalition / response=assess stat=mean datalabel limitstat=clm; 
	title "Figure 1. Mean Self-Assessment (By Coalition)";
RUN;
ods graphics off;&lt;BR /&gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get data labels to two decimals, but no value labels.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="figure1a23.png" style="width: 443px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24463i26BB926F67EA8F54/image-dimensions/443x388?v=v2" width="443" height="388" role="button" title="figure1a23.png" alt="figure1a23.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm clearly not understanding SAS's formatting procedures; there's something I'm missing "upstream," but I can't figure out what it is.&amp;nbsp; Could someone throw me a bone, here?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;David&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 20:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-datalabels-without-overriding-value-label-formats-in/m-p/508499#M1662</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-29T20:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting datalabels without overriding value label formats in SGPLOT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-datalabels-without-overriding-value-label-formats-in/m-p/508962#M1713</link>
      <description>&lt;P&gt;Many thanks, Reeza.&amp;nbsp; It took a little bit of doing, but I got some code that worked!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 22:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-datalabels-without-overriding-value-label-formats-in/m-p/508962#M1713</guid>
      <dc:creator>dbcrow</dc:creator>
      <dc:date>2018-10-30T22:24:27Z</dc:date>
    </item>
  </channel>
</rss>

