<?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: Style template compile error in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65383#M2217</link>
    <description>Thanks.&lt;BR /&gt;
&lt;BR /&gt;
I got from SAS online document. The link is:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/grstatgraph/63878/HTML/default/viewer.htm#p0icsws0thpaghn1t12m27fyqnjc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/grstatgraph/63878/HTML/default/viewer.htm#p0icsws0thpaghn1t12m27fyqnjc.htm&lt;/A&gt;</description>
    <pubDate>Thu, 12 May 2011 15:31:23 GMT</pubDate>
    <dc:creator>CharlieHe</dc:creator>
    <dc:date>2011-05-12T15:31:23Z</dc:date>
    <item>
      <title>Style template compile error</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65380#M2214</link>
      <description>Copied code from 9.2 document and tried to compile with error.&lt;BR /&gt;
Code:&lt;BR /&gt;
&lt;I&gt;proc template;&lt;BR /&gt;
  define style Styles.MyDefault;&lt;BR /&gt;
    parent=Styles.Default;&lt;BR /&gt;
&lt;BR /&gt;
    style GraphData1 /&lt;BR /&gt;
      MarkerSymbol=DIAMOND;&lt;BR /&gt;
    style GraphData2 /&lt;BR /&gt;
      MarkerSymbol=CROSS;&lt;BR /&gt;
    style GraphData3 /&lt;BR /&gt;
      MarkerSymbol=CIRCLE;&lt;BR /&gt;
  end;&lt;BR /&gt;
&lt;BR /&gt;
  define statgraph testSymbols;&lt;BR /&gt;
    begingraph;&lt;BR /&gt;
      layout Overlay;&lt;BR /&gt;
        scatterPlot y=height x=weight / group=age&lt;BR /&gt;
          markerattrs=(symbol=MyDefault);&lt;BR /&gt;
      endlayout;&lt;BR /&gt;
    endgraph;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
SAS LOG:&lt;BR /&gt;
&lt;BR /&gt;
1    proc template;&lt;BR /&gt;
2      define style Styles.MyDefault;&lt;BR /&gt;
3        parent=Styles.Default;&lt;BR /&gt;
4&lt;BR /&gt;
5        style GraphData1 /&lt;BR /&gt;
6          MarkerSymbol=DIAMOND;&lt;BR /&gt;
                               -&lt;BR /&gt;
                               180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
7        style GraphData2 /&lt;BR /&gt;
8          MarkerSymbol=CROSS;&lt;BR /&gt;
                             -&lt;BR /&gt;
                             180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
9        style GraphData3 /&lt;BR /&gt;
10         MarkerSymbol=CIRCLE;&lt;BR /&gt;
                              -&lt;BR /&gt;
                              180&lt;BR /&gt;
ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;BR /&gt;
11     end;&lt;BR /&gt;
WARNING: Object will not be saved.&lt;BR /&gt;
12&lt;BR /&gt;
13     define statgraph testSymbols;&lt;BR /&gt;
14       begingraph;&lt;BR /&gt;
15         layout Overlay;&lt;BR /&gt;
16           scatterPlot y=height x=weight / group=age&lt;BR /&gt;
17             markerattrs=(symbol=MyDefault);&lt;BR /&gt;
                                   ---------&lt;BR /&gt;
                                   772&lt;BR /&gt;
ERROR 772-580: Syntax error: expecting a constant or a dynamic.&lt;BR /&gt;
18         endlayout;&lt;BR /&gt;
19       endgraph;&lt;BR /&gt;
20     end;&lt;BR /&gt;
WARNING: Object will not be saved.&lt;BR /&gt;
21   run;&lt;BR /&gt;
NOTE: PROCEDURE TEMPLATE used (Total process time):&lt;BR /&gt;
      real time           0.07 seconds&lt;BR /&gt;
      cpu time            0.06 seconds&lt;BR /&gt;
&lt;BR /&gt;
WARNING: Errors were produced.&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
22&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
23   proc template;&lt;BR /&gt;
24     define style Styles.MyDefault;&lt;BR /&gt;
25       parent=Styles.Default;&lt;BR /&gt;
26&lt;BR /&gt;
27       style GraphData1 /&lt;BR /&gt;
28         LineStyle=6;&lt;BR /&gt;
29       style GraphData2 /&lt;BR /&gt;
30         LineStyle=4;&lt;BR /&gt;
31     end;&lt;BR /&gt;
NOTE: Overwriting existing template/link: Styles.MyDefault&lt;BR /&gt;
NOTE: STYLE 'Styles.MyDefault' has been saved to: SASUSER.TEMPLAT&lt;BR /&gt;
32&lt;BR /&gt;
33     define statgraph testPattern;&lt;BR /&gt;
34       begingraph;&lt;BR /&gt;
35         layout overlay;&lt;BR /&gt;
36           scatterplot y=height x=weight / group=gender;&lt;BR /&gt;
37           lineparm yintercept=intercept  slope=slope / group=gender&lt;BR /&gt;
                      ----------&lt;BR /&gt;
                      22&lt;BR /&gt;
                      76&lt;BR /&gt;
ERROR 22-322: Syntax error, expecting one of the following: SLOPE, X, Y.&lt;BR /&gt;
ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;
38             lineattrs=(pattern=MyDefault);&lt;BR /&gt;
39         endlayout;&lt;BR /&gt;
40       endgraph;&lt;BR /&gt;
41     end;&lt;BR /&gt;
WARNING: Object will not be saved.&lt;BR /&gt;
42   run;&lt;BR /&gt;
NOTE: PROCEDURE TEMPLATE used (Total process time):&lt;BR /&gt;
      real time           0.04 seconds&lt;BR /&gt;
      cpu time            0.04 seconds&lt;BR /&gt;
&lt;BR /&gt;
WARNING: Errors were produced.&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
&lt;BR /&gt;
Please tell me what is wrong. I have SAS 9.2 TS level 2M3.</description>
      <pubDate>Thu, 12 May 2011 14:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65380#M2214</guid>
      <dc:creator>CharlieHe</dc:creator>
      <dc:date>2011-05-12T14:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Style template compile error</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65381#M2215</link>
      <description>The symbol names need to be in quotes: markersymbol="diamond";&lt;BR /&gt;
Where did you see this example?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Dan</description>
      <pubDate>Thu, 12 May 2011 15:19:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65381#M2215</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2011-05-12T15:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Style template compile error</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65382#M2216</link>
      <description>Symbol values should be strings:&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
  define style Styles.MyDefault;&lt;BR /&gt;
    parent=Styles.Default;&lt;BR /&gt;
&lt;BR /&gt;
    style GraphData1 /&lt;BR /&gt;
      MarkerSymbol='DIAMOND';&lt;BR /&gt;
    style GraphData2 /&lt;BR /&gt;
      MarkerSymbol='CROSS';&lt;BR /&gt;
    style GraphData3 /&lt;BR /&gt;
      MarkerSymbol='CIRCLE';&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Also, it is preferred to derive each style element from the parent, and change the attributes needed:&lt;BR /&gt;
  style GraphData3 from GraphData3 /&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
You need to remove the following option in the scatterplot statement:&lt;BR /&gt;
Markerattrs=(symbol=MyDefault).&lt;BR /&gt;
&lt;BR /&gt;
Lastly, to create the graph, you need:&lt;BR /&gt;
proc sgrender data=foo template=testSymbols;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 12 May 2011 15:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65382#M2216</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2011-05-12T15:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Style template compile error</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65383#M2217</link>
      <description>Thanks.&lt;BR /&gt;
&lt;BR /&gt;
I got from SAS online document. The link is:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/grstatgraph/63878/HTML/default/viewer.htm#p0icsws0thpaghn1t12m27fyqnjc.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/grstatgraph/63878/HTML/default/viewer.htm#p0icsws0thpaghn1t12m27fyqnjc.htm&lt;/A&gt;</description>
      <pubDate>Thu, 12 May 2011 15:31:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65383#M2217</guid>
      <dc:creator>CharlieHe</dc:creator>
      <dc:date>2011-05-12T15:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Style template compile error</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65384#M2218</link>
      <description>To see your changes in a graph, use the following:&lt;BR /&gt;
&lt;BR /&gt;
ods listing style=styles.mydefault;&lt;BR /&gt;
proc sgrender data=sashelp.class template=testsymbols;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The marker symbols you have defined will automatically be used for the first 3 values of the group variable.  Since you have not derived your elements, they will only have markers, and not colors.&lt;BR /&gt;
&lt;BR /&gt;
Use this code to see the legend with all values of age:&lt;BR /&gt;
&lt;BR /&gt;
  define statgraph testSymbols;&lt;BR /&gt;
    begingraph;&lt;BR /&gt;
      layout Overlay;&lt;BR /&gt;
        scatterPlot y=height x=weight / group=age name='s';&lt;BR /&gt;
        discretelegend 's';&lt;BR /&gt;
      endlayout;&lt;BR /&gt;
    endgraph;</description>
      <pubDate>Thu, 12 May 2011 18:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65384#M2218</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2011-05-12T18:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Style template compile error</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65385#M2219</link>
      <description>Thanks Sanja. Now it works.&lt;BR /&gt;
Just curious why the statement "Markerattrs=(symbol=MyDefault)" does not work.&lt;BR /&gt;
I actually like the syntax since it will apply the style to the marker only.&lt;BR /&gt;
With the statement "ods listing style=styles.mydefault;", it seems the style will apply globlally now.</description>
      <pubDate>Thu, 12 May 2011 22:22:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65385#M2219</guid>
      <dc:creator>CharlieHe</dc:creator>
      <dc:date>2011-05-12T22:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Style template compile error</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65386#M2220</link>
      <description>Markerattrs=(symbol=circle) or markerattrs=(color=black) does work as expected.  You just cannot assign a list of symbols or colors in this way.&lt;BR /&gt;
&lt;BR /&gt;
ODS Graphics automatically applies the settings from the style to the group colors, symbols and line patterns.  By doing this, all graphs in your report will have consistent attributes for the same group value.  These colors, marker symbols etc have been carefully chosen by GUI experts to provide maximum clarity and discriminability between different groups when using the default styles.&lt;BR /&gt;
&lt;BR /&gt;
Furthermore, there are many styles shipped by SAS for you to use.  The whole idea is to create aesthetic and effective graphs out of the box without users having to spend time finding good combination of colors. Of course, if you need, you can design your own style too.  &lt;BR /&gt;
&lt;BR /&gt;
If you are not using a group variable, you can change the setting of the plot by using the markerattrs=(symbol=circle, color=black) or whatever you need.  If you have a graph made up of multiple scatter or series plots, one per column, you can control the color and other attributes of each plot by using this feature.&lt;BR /&gt;
&lt;BR /&gt;
In future release, there may be a way to set group colors, markers, etc in the syntax itself.</description>
      <pubDate>Thu, 12 May 2011 23:56:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Style-template-compile-error/m-p/65386#M2220</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2011-05-12T23:56:57Z</dc:date>
    </item>
  </channel>
</rss>

