<?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: BY statement and GTL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75127#M2795</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I don't have a copy of SAS 9.1 to test this code, but I did get a modified version to work with 9.2 (9.2 has begingraph/endgraph blocks, the lattice layout option rowdatarange instead of hrange, and PROC SGRENDER).  Depending on the status of dynamic variables as of 9.1, you might be able to use one for the ENTRY statements' text.&lt;BR /&gt;
&lt;BR /&gt;
-Randy&lt;BR /&gt;
&lt;BR /&gt;
data class(drop=height keep=weight height:);&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   select (age);&lt;BR /&gt;
      when (11) height11=height;&lt;BR /&gt;
      when (12) height12=height;&lt;BR /&gt;
      when (13) height13=height;&lt;BR /&gt;
      when (14) height14=height;&lt;BR /&gt;
      when (15) height15=height;&lt;BR /&gt;
      when (16) height16=height;&lt;BR /&gt;
      otherwise;&lt;BR /&gt;
   end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods graphics on;&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
    define statgraph lattice_test; &lt;BR /&gt;
&lt;BR /&gt;
        layout lattice / columns=2 columngutter=5 rowgutter=5 vrange=unionall;&lt;BR /&gt;
        &lt;BR /&gt;
	    cell;&lt;BR /&gt;
              cellheader;&lt;BR /&gt;
	          entry "Age 11";&lt;BR /&gt;
              endcellheader;&lt;BR /&gt;
              scatterplot x=weight y=height11;&lt;BR /&gt;
          endcell;&lt;BR /&gt;
&lt;BR /&gt;
          cell;&lt;BR /&gt;
              cellheader;&lt;BR /&gt;
                  entry "Age 12";&lt;BR /&gt;
	      endcellheader;&lt;BR /&gt;
              scatterplot x=weight y=height12;&lt;BR /&gt;
          endcell;&lt;BR /&gt;
&lt;BR /&gt;
          cell;&lt;BR /&gt;
             cellheader;&lt;BR /&gt;
	         entry "Age 13";&lt;BR /&gt;
	     endcellheader;&lt;BR /&gt;
             scatterplot x=weight y=height13;&lt;BR /&gt;
         endcell;&lt;BR /&gt;
&lt;BR /&gt;
         cell;&lt;BR /&gt;
            cellheader;&lt;BR /&gt;
	       entry "Age 14";&lt;BR /&gt;
	    endcellheader;&lt;BR /&gt;
            scatterplot x=weight y=height14;&lt;BR /&gt;
         endcell;&lt;BR /&gt;
&lt;BR /&gt;
         cell;&lt;BR /&gt;
	     cellheader;&lt;BR /&gt;
		 entry "Age 15";&lt;BR /&gt;
	     endcellheader;&lt;BR /&gt;
             scatterplot x=weight y=height15;&lt;BR /&gt;
        endcell;&lt;BR /&gt;
&lt;BR /&gt;
        cell;&lt;BR /&gt;
	    cellheader;&lt;BR /&gt;
		entry "Age 16";&lt;BR /&gt;
	    endcellheader;&lt;BR /&gt;
            scatterplot x=weight y=height16;&lt;BR /&gt;
        endcell;&lt;BR /&gt;
&lt;BR /&gt;
    endlayout;&lt;BR /&gt;
&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  set class;&lt;BR /&gt;
  attrib weight label='Weight' height: label='Height';&lt;BR /&gt;
  file print ods=(template='lattice_test');&lt;BR /&gt;
  put _ods_;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 12 Oct 2009 15:02:18 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-10-12T15:02:18Z</dc:date>
    <item>
      <title>BY statement and GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75123#M2791</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
I used the proc greplay to order several graphs on a same page after to have created them with a proc gplot + BY statement.&lt;BR /&gt;
&lt;BR /&gt;
Now, again with SAS 9.1, I'd like to know if the GTL could simplify this process. I'm not sure because I turn around the GROUP= statement and datagrid without success.&lt;BR /&gt;
&lt;BR /&gt;
Some of you have a idea or the good way to do that for example&lt;BR /&gt;
I start with a proc gplot and a BY statement. I'd like a template to distribut each graphic on a grid (in order to have them on one page only) :&lt;BR /&gt;
&lt;BR /&gt;
proc gplot data=sashelp.class;&lt;BR /&gt;
by age;&lt;BR /&gt;
plot weight*height;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Stéphane.

Message was edited by: Stephane</description>
      <pubDate>Thu, 08 Oct 2009 17:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75123#M2791</guid>
      <dc:creator>Stephane</dc:creator>
      <dc:date>2009-10-08T17:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: BY statement and GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75124#M2792</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
You can use PROC SGPANEL to create a plot for each value of the "BY" variable.  &lt;BR /&gt;
&lt;BR /&gt;
* Sorting by PANELBY variable not required;&lt;BR /&gt;
proc sgpanel data=sashelp.class;&lt;BR /&gt;
  panelby age;&lt;BR /&gt;
  scatter x=height y=weight;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
You can use the template browser to view the generated GTL in the WORK library.&lt;BR /&gt;
&lt;BR /&gt;
-Randy</description>
      <pubDate>Fri, 09 Oct 2009 15:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75124#M2792</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-09T15:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: BY statement and GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75125#M2793</link>
      <description>Unfortunately, the pre-production version of GTL in 9.1 did not have the ability to panel plots based on classification.  In 9.1, you would need to split the data into separate columns based on the BY-group value and use a Layout Lattice in GTL.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Dan</description>
      <pubDate>Fri, 09 Oct 2009 19:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75125#M2793</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2009-10-09T19:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: BY statement and GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75126#M2794</link>
      <description>ok thanks.</description>
      <pubDate>Mon, 12 Oct 2009 12:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75126#M2794</guid>
      <dc:creator>Stephane</dc:creator>
      <dc:date>2009-10-12T12:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: BY statement and GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75127#M2795</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I don't have a copy of SAS 9.1 to test this code, but I did get a modified version to work with 9.2 (9.2 has begingraph/endgraph blocks, the lattice layout option rowdatarange instead of hrange, and PROC SGRENDER).  Depending on the status of dynamic variables as of 9.1, you might be able to use one for the ENTRY statements' text.&lt;BR /&gt;
&lt;BR /&gt;
-Randy&lt;BR /&gt;
&lt;BR /&gt;
data class(drop=height keep=weight height:);&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   select (age);&lt;BR /&gt;
      when (11) height11=height;&lt;BR /&gt;
      when (12) height12=height;&lt;BR /&gt;
      when (13) height13=height;&lt;BR /&gt;
      when (14) height14=height;&lt;BR /&gt;
      when (15) height15=height;&lt;BR /&gt;
      when (16) height16=height;&lt;BR /&gt;
      otherwise;&lt;BR /&gt;
   end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
ods graphics on;&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
    define statgraph lattice_test; &lt;BR /&gt;
&lt;BR /&gt;
        layout lattice / columns=2 columngutter=5 rowgutter=5 vrange=unionall;&lt;BR /&gt;
        &lt;BR /&gt;
	    cell;&lt;BR /&gt;
              cellheader;&lt;BR /&gt;
	          entry "Age 11";&lt;BR /&gt;
              endcellheader;&lt;BR /&gt;
              scatterplot x=weight y=height11;&lt;BR /&gt;
          endcell;&lt;BR /&gt;
&lt;BR /&gt;
          cell;&lt;BR /&gt;
              cellheader;&lt;BR /&gt;
                  entry "Age 12";&lt;BR /&gt;
	      endcellheader;&lt;BR /&gt;
              scatterplot x=weight y=height12;&lt;BR /&gt;
          endcell;&lt;BR /&gt;
&lt;BR /&gt;
          cell;&lt;BR /&gt;
             cellheader;&lt;BR /&gt;
	         entry "Age 13";&lt;BR /&gt;
	     endcellheader;&lt;BR /&gt;
             scatterplot x=weight y=height13;&lt;BR /&gt;
         endcell;&lt;BR /&gt;
&lt;BR /&gt;
         cell;&lt;BR /&gt;
            cellheader;&lt;BR /&gt;
	       entry "Age 14";&lt;BR /&gt;
	    endcellheader;&lt;BR /&gt;
            scatterplot x=weight y=height14;&lt;BR /&gt;
         endcell;&lt;BR /&gt;
&lt;BR /&gt;
         cell;&lt;BR /&gt;
	     cellheader;&lt;BR /&gt;
		 entry "Age 15";&lt;BR /&gt;
	     endcellheader;&lt;BR /&gt;
             scatterplot x=weight y=height15;&lt;BR /&gt;
        endcell;&lt;BR /&gt;
&lt;BR /&gt;
        cell;&lt;BR /&gt;
	    cellheader;&lt;BR /&gt;
		entry "Age 16";&lt;BR /&gt;
	    endcellheader;&lt;BR /&gt;
            scatterplot x=weight y=height16;&lt;BR /&gt;
        endcell;&lt;BR /&gt;
&lt;BR /&gt;
    endlayout;&lt;BR /&gt;
&lt;BR /&gt;
end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  set class;&lt;BR /&gt;
  attrib weight label='Weight' height: label='Height';&lt;BR /&gt;
  file print ods=(template='lattice_test');&lt;BR /&gt;
  put _ods_;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 12 Oct 2009 15:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75127#M2795</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-12T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: BY statement and GTL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75128#M2796</link>
      <description>that's interesting Randy thanks. I developped a macro that count the number of graphs and to create dynamically the greplay grid.&lt;BR /&gt;
I wanted to find a way with GTL to do that and this is the Proc SGPANEL I think because if I assume to industrialise your last proposition I will do a similar macro program.&lt;BR /&gt;
&lt;BR /&gt;
A new reason to go to SAS 9.2 for my client isn't it ?</description>
      <pubDate>Mon, 12 Oct 2009 19:34:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/BY-statement-and-GTL/m-p/75128#M2796</guid>
      <dc:creator>Stephane</dc:creator>
      <dc:date>2009-10-12T19:34:15Z</dc:date>
    </item>
  </channel>
</rss>

