<?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: SGPLOT VBAR and a user defined format on the category variable in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125727#M4870</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Frank &amp;amp; Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We just made a Defect out of this.&lt;/P&gt;&lt;P&gt;Thanks for your input, making SAS better!&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jul 2013 13:11:06 GMT</pubDate>
    <dc:creator>Jan_TSNL</dc:creator>
    <dc:date>2013-07-10T13:11:06Z</dc:date>
    <item>
      <title>SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125721#M4864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I started to use SGPLOT (it was on my list for sometime, but now I doing work for a site with EG connected to a server that does not have SAS/Graph).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a simple VBAR very quickly, but am surprised that user defined formats do not seem to work when used on the variable that defines the bars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an example I have the following code (changed to work with a SASHELP table). I added the GPLOT and FREQ procs just to show the effect of the user defined format.&lt;/P&gt;&lt;P&gt;When I use the NLDATEMD format it runs as expected, grouping data per month-day combination.&lt;/P&gt;&lt;P&gt;When I use the DAGNUM format SGPLOT shows one bar labeled %0d, and prints a warning &lt;EM&gt;"The data for a BARCHARTPARM statement are not appropriate. The BARCHARTPARM statement expects summarized data. The bar chart might not be drawn correctly." &lt;/EM&gt;But the NLDATEMD format also leads to aggregation, and this happens without problems. And my original code did have only one observation per bar (it contained data for a single month, that's why I wanted only the number of the day displayed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have SAS 9.3 on the server.&lt;/P&gt;&lt;P&gt;Or am I missing something in the documentation; or doing something silly?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc format ; &lt;BR /&gt; picture dagnum&amp;nbsp; low-high='%0d' ( datatype=date ); &lt;BR /&gt; run ; &lt;BR /&gt;data ; &lt;BR /&gt; do x = '1jun2013'd to '30jun2013'd by 5 ; &lt;BR /&gt; put x= dagnum2. ;&lt;BR /&gt;end ; &lt;BR /&gt;run ; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;/*%let format = nldatemd. ;*/&lt;BR /&gt;%let format = dagnum. ; &lt;BR /&gt; &lt;BR /&gt;proc sgplot data=sashelp.stocks ( where= (stock="IBM") ) ; &lt;BR /&gt;vbar date / response=open ;&lt;BR /&gt;format date &amp;amp;format ; &lt;BR /&gt;run ; &lt;BR /&gt; &lt;BR /&gt;proc gchart data=sashelp.stocks ( where= (stock="IBM") ) ;&lt;BR /&gt;vbar date / discrete sumvar=open ;&lt;BR /&gt;format date &amp;amp;format ; &lt;BR /&gt;run ; &lt;BR /&gt; &lt;BR /&gt;proc freq&amp;nbsp; data=sashelp.stocks ( where= (stock="IBM") ) ;&lt;BR /&gt;tables date ;&lt;BR /&gt;format date &amp;amp;format ;&lt;BR /&gt;run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 12:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125721#M4864</guid>
      <dc:creator>FrankPoppe</dc:creator>
      <dc:date>2013-07-03T12:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125722#M4865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;the first thing that comes to mind is that you are missing the letter 't' in the &lt;EM&gt;&amp;amp;forma&lt;STRONG&gt;t&lt;/STRONG&gt;&lt;/EM&gt; in this statement:&lt;/P&gt;&lt;P&gt;proc gchart data=sashelp.stocks ( where= (stock="IBM") ) ;&lt;/P&gt;&lt;P&gt;vbar date / discrete sumvar=open ;&lt;/P&gt;&lt;P&gt;format date &lt;STRONG&gt;&amp;amp;forma; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try and see what happens now?&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 13:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125722#M4865</guid>
      <dc:creator>AncaTilea</dc:creator>
      <dc:date>2013-07-03T13:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125723#M4866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, that was a typo introduced while formatting this message. I'll edit the message.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 13:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125723#M4866</guid>
      <dc:creator>FrankPoppe</dc:creator>
      <dc:date>2013-07-03T13:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125724#M4867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There may be a bug with the java formatter for this particular format.&amp;nbsp; Try this code.&amp;nbsp; It formats the data on server, and then sends it to SGPLOT.&amp;nbsp; The warning message is an internal issue that may be a bit confusing.&amp;nbsp; We'll look into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc format ; &lt;BR /&gt; picture dagnum&amp;nbsp; low-high='%0d' ( datatype=date ); &lt;BR /&gt; run ; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data ; &lt;BR /&gt; do x = '1jun2013'd to '30jun2013'd by 5 ; &lt;BR /&gt; put x= dagnum2. ;&lt;BR /&gt;end ; &lt;BR /&gt;run ; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data formatted;&lt;BR /&gt;&amp;nbsp; set sashelp.stocks ( where= (stock="IBM") );&lt;BR /&gt;&amp;nbsp; NewDate=put(date, dagnum2.);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;proc sgplot data=formatted ; &lt;BR /&gt;vbar newdate / response=open&lt;/P&gt;&lt;P&gt;run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Dagnum1.png" class="jive-image" src="https://communities.sas.com/legacyfs/online/3835_Dagnum1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 13:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125724#M4867</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2013-07-03T13:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125725#M4868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First massaging the data is of course an option. I tried to avoid that.&lt;/P&gt;&lt;P&gt;I won't even need the format then, I can just use the DAY function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 13:25:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125725#M4868</guid>
      <dc:creator>FrankPoppe</dc:creator>
      <dc:date>2013-07-03T13:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125726#M4869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is likely a bug.&amp;nbsp; Feel free to report it to Tech Support.&amp;nbsp; We'll look into it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 13:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125726#M4869</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2013-07-03T13:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125727#M4870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Frank &amp;amp; Sanjay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We just made a Defect out of this.&lt;/P&gt;&lt;P&gt;Thanks for your input, making SAS better!&lt;/P&gt;&lt;P&gt;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 13:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/125727#M4870</guid>
      <dc:creator>Jan_TSNL</dc:creator>
      <dc:date>2013-07-10T13:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/230122#M8336</link>
      <description>&lt;P&gt;I'm still seeing this bug in 9.4.&amp;nbsp;As&amp;nbsp;Sanjay&amp;nbsp;mentioned, a workaround is to write the variable with the user-defined format into a new variable without a user-defined format (using PUT).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my experience&amp;nbsp;this error is thrown inconsistently, requiring previously error-free code to be patched.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 16:50:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/230122#M8336</guid>
      <dc:creator>AndyK_</dc:creator>
      <dc:date>2015-10-15T16:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/230128#M8338</link>
      <description>&lt;P&gt;User Defined Formats are supported in&amp;nbsp;general for SGPLOT, but there is a known lack of support for some picture format features for all ODS Graphics procedures. &amp;nbsp;As mentioned earlier, a workaround&amp;nbsp;would be to create another variable&amp;nbsp;day=put(date, dagnum.); and then plot that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data stocks;&lt;BR /&gt;&amp;nbsp; set sashelp.stocks ( where= (stock="IBM") );&lt;BR /&gt;&amp;nbsp; day=put(date, dagnum.);&lt;BR /&gt; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=stocks ( where= (stock="IBM") ) ; &lt;BR /&gt;&amp;nbsp; vbar day / response=open ;&lt;BR /&gt;run ; &lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2015 17:37:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/230128#M8338</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2015-10-15T17:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBAR and a user defined format on the category variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/230139#M8341</link>
      <description>Thanks Sanjay, that's good to know. I will keep an eye out on other ODS graphics procedures. In my particular case it was a user-defined numeric format causing the issue, not a picture format.</description>
      <pubDate>Thu, 15 Oct 2015 19:12:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBAR-and-a-user-defined-format-on-the-category-variable/m-p/230139#M8341</guid>
      <dc:creator>AndyK_</dc:creator>
      <dc:date>2015-10-15T19:12:04Z</dc:date>
    </item>
  </channel>
</rss>

