SAS: How do I use ODS layout to put 8 graphs on 2 PDF pages? -
i using sas ods create pdf documents. code below works put 4 graphs on 1 page. if try put 8 graphs on 2 pages, 4 graphs on 1 page. tried copying part between lines of asterixes , pasting again above "ods pdf close;" didn't work. tried adding "ods startpage = now;" between two, didn't work either. how can put 8 graphs on 2 pages?
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;
the code based on this article.
good question, in opinion poorly documented anywhere.
you're there: need close layout "container", force new page, open new layout next page:
ods pdf file="file.pdf" startpage=never; * page 1; ods layout start <dimensions>; ods region <dimensions>; proc whatever; run; ods region <dimensions>; proc whatever; run; ods layout end; *<etc. page 1 content>; * start page 2; ods pdf startpage=now; * page 2; ods layout start <dimensions>; ods region <dimensions>; proc whatever; run; ods region <dimensions>; proc whatever; run; ods layout end; *<etc. page 2 content>; ods pdf close;
Comments
Post a Comment