title: SAS: How do I use ODS layout to put 8 graphs on 2 PDF pages?
body: <p>I am using SAS ODS to create PDF documents. The code below works to put 4 graphs on 1 page. But if I try to put 8 graphs on 2 pages, all I get is 4 graphs on 1 page. I tried copying the part between the lines of asterixes and pasting it again above "ods pdf close;" but that didn't work. I also tried adding "ods startpage = now;" between the two, but that didn't work either. How can I put 8 graphs on 2 pages?</p>
  
  <pre><code>goptions reset=all;
  
  data test;
  input x y @@;
  datalines;
  1 2 2 4 3 8 4 10 5 15
  ;
  run;
  ods pdf file="[path]/output.pdf" ;
  
  ****
  ods layout Start width=10in height=8in ;
  ods region x=0 y=5% width=45% height=45%;
  proc gplot data=test;
  title2 'PLOT #1';
  plot y*x /name="mygraph1" noframe;
  run;
  ods region x=55% y=5% width=45% height=45%;
  title2 'PLOT #2';
  plot y*x /name="mygraph2" noframe;
  run;
  ods region x=0 y=51% width=45% height=45%;
  title2 'PLOT #3';
  plot y*x / name="Mygraph3" noframe;
  run;
  ods region x=55% Y=51% width=45% height=45%;
  title2 'PLOT #4';
  plot y*x / name="Mygraph4" noframe;
  run;
  quit;
  ods layout end;
  ****
  
  ods pdf close;
  </code></pre>
  
  <p>The code is based on <a href="http://www2.sas.com/proceedings/sugi28/094-28.pdf" rel="nofollow noreferrer">this article</a>.</p>