<?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 Re: Variables in a PROC SGPLOT - formats not being applied in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704247#M215877</link>
    <description>&lt;P&gt;Thanks for the reply and you are correct in your response - IA, MS, and UT are meant to be Iowa, Mississippi, and Utah.&lt;/P&gt;&lt;P&gt;I took another look at my log and it seems the issue was with the formats themselves - they output to the data set okay but attempting to apply them to the graph produced this log error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           0.24 seconds
       cpu time            0.11 seconds
       
 DEBUG: Incomplete range-value definition
 DEBUG: Incomplete range-value definition
 DEBUG: Incomplete range-value definition
 NOTE: There were 3 observations read from the data set WORK.CROSSTABLE.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I figured this must a problem with the format itself not applying correctly so I ended up revisiting my user defined formats. It turns out the format was missing a space between ' ' for the 'Unknown' value so it wasn't applying to the graph properly. I fixed this and it worked, although I am still not sure why there were no issues with the source data set.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;VALUE $StateCd
    ''  	  = 'Unknown'
    'IA'      = 'Iowa'
    'MS'   	  = 'Mississippi'
    'UT'      = 'Utah';&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 10 Dec 2020 15:09:41 GMT</pubDate>
    <dc:creator>ESwei</dc:creator>
    <dc:date>2020-12-10T15:09:41Z</dc:date>
    <item>
      <title>Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704002#M215773</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a new user attempting to create a graph for a class project. The output must match the provided example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My output is as follows:&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;P&gt;The "State Code" in the X axis is discrepant - it appears SAS is not applying the following user defined format:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FORMAT LIBRARY = HypTabs.HypFormats;
VALUE $StateCd
    ''  	  = 'Unknown'
    'IA'      = 'Iowa'
    'MS'   	  = 'Mississippi'
    'UT'      = 'Utah'
    OTHER     = 'Unexpected Value';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note that this format applies to the output data without issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea why this could be happening?&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704002#M215773</guid>
      <dc:creator>ESwei</dc:creator>
      <dc:date>2020-12-10T15:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704003#M215774</link>
      <description>xaxis valuesformat=$statecd.;&lt;BR /&gt;yaxis valuesformat=6.4;</description>
      <pubDate>Mon, 07 Dec 2020 00:33:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704003#M215774</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-07T00:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704023#M215779</link>
      <description>Thanks for the reply and your help, unfortunately that solution did not work</description>
      <pubDate>Mon, 07 Dec 2020 02:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704023#M215779</guid>
      <dc:creator>ESwei</dc:creator>
      <dc:date>2020-12-07T02:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704112#M215823</link>
      <description>&lt;P&gt;Let me point out, for your future benefit so that you can get the help you need faster, that words like "&lt;SPAN&gt;that solution did not work" with no additional explanation never leads to anything helpful. The next question that gets asked is always: please provide more information.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In this case, show us the code you tried, and the output you got.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 11:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704112#M215823</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-12-07T11:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704198#M215857</link>
      <description>&lt;P&gt;This format&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;PROC FORMAT LIBRARY = HypTabs.HypFormats;
VALUE $StateCd
    ''  	  = 'Unknown'
    'IA'      = 'Iowa'
    'MS'   	  = 'Mississippi'
    'UT'      = 'Utah'
    OTHER     = 'Unexpected Value';
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will display a value from your data set of "IA" as "Iowa". So, which value is in your data set? That goes on the &lt;STRONG&gt;left&lt;/STRONG&gt; of the = sign in the format and the value on the &lt;STRONG&gt;right&lt;/STRONG&gt; is what you want to see in your output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I suspect you have define this format incorrectly at least.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 16:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704198#M215857</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-12-07T16:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704229#M215868</link>
      <description>&lt;P&gt;I understood the OP's initial statement to mean they are getting IA, MS, and UT in the chart, but want to see Iowa, Mississippi, and Utah.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/344622"&gt;@ESwei&lt;/a&gt;, do I understand correctly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, then the proc format assignments should not be reversed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, we have not been shown the log, so it may be that the program has not issued a FMTSEARCH option telling SAS to search for SGPLOT-requested formats in the HypTabs.HypFormats catalog.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But we can't answer that question without seeing the log and relevant code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 18:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704229#M215868</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-12-07T18:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704241#M215874</link>
      <description>&lt;P&gt;I am sorry for my mistake.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Inserting the code xaxis valuesformat=$statecd. looks like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT DATA = Work.CrossTable;
	REFLINE 1.8 / AXIS = Y
	LINEATTRS = ( COLOR = INDIGO
	PATTERN = SHORTDASH)
	LABEL = 'National Average = 1.8'
	LABELLOC = INSIDE
	LABELPOS = MAX;
	VBAR StateCd / RESPONSE = ColPercent
	FILLATTRS = (COLOR = LIGHTSALMON)
	DATALABEL = ColPercent;
	FORMAT Colpercent 6.4;
	
	
	XAXIS
	LABEL = 'State Code'
	LABELATTRS = (WEIGHT = BOLD)
	VALUESFORMAT = $StateCd.;
	
	YAXIS VALUES = (0 TO 4 BY 1)
	GRID
	OFFSETMIN = 0
	LABEL = 'Percent'
	LABELATTRS = (WEIGHT = BOLD);
	
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;The output of the graph is unchanged from previously posted.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 18:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704241#M215874</guid>
      <dc:creator>ESwei</dc:creator>
      <dc:date>2020-12-07T18:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: Variables in a PROC SGPLOT - formats not being applied</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704247#M215877</link>
      <description>&lt;P&gt;Thanks for the reply and you are correct in your response - IA, MS, and UT are meant to be Iowa, Mississippi, and Utah.&lt;/P&gt;&lt;P&gt;I took another look at my log and it seems the issue was with the formats themselves - they output to the data set okay but attempting to apply them to the graph produced this log error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; NOTE: PROCEDURE SGPLOT used (Total process time):
       real time           0.24 seconds
       cpu time            0.11 seconds
       
 DEBUG: Incomplete range-value definition
 DEBUG: Incomplete range-value definition
 DEBUG: Incomplete range-value definition
 NOTE: There were 3 observations read from the data set WORK.CROSSTABLE.
 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I figured this must a problem with the format itself not applying correctly so I ended up revisiting my user defined formats. It turns out the format was missing a space between ' ' for the 'Unknown' value so it wasn't applying to the graph properly. I fixed this and it worked, although I am still not sure why there were no issues with the source data set.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;VALUE $StateCd
    ''  	  = 'Unknown'
    'IA'      = 'Iowa'
    'MS'   	  = 'Mississippi'
    'UT'      = 'Utah';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2020 15:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variables-in-a-PROC-SGPLOT-formats-not-being-applied/m-p/704247#M215877</guid>
      <dc:creator>ESwei</dc:creator>
      <dc:date>2020-12-10T15:09:41Z</dc:date>
    </item>
  </channel>
</rss>

