Search code examples
pdfsassas-ods

SAS - how to put multiple graphs into one page


Trying to put multiple graphs(from proc sgplot) into one page PDF with SAS and need your kind help. Any good solution please?

Since the graphs are created using proc sgplot, no results are stored in SAS catolog, which makes proc greplay not work. And I also tried to store png in disc and read them back to SAS and then ran greplay. However quality of the graphs deteriorate during it.

It's for a big report and needs refresh weekly, manual work will be a disaster...

Thank you.


Solution

  • I have tried this before and found it to be pretty buggy, but if you are interested in giving it a try, this is supposed to do what you are asking for. Just change x, y, width, and height to fit the sizes you want for each region.

    ods pdf file='file.pdf' startpage=no;
    
    ods layout start width=8in height=10.5in; /*identify width and height of entire page leaving room for margins*/
    ods region x=0in width=2.25in y=0in height=5in; /*identify region boundaries*/
    {code with output}
    ods region x=2.5in width=2.25in y=0in height=5in; /*identify region boundaries*/
    {code with output}
    ods region x=5in width=2.25in y=0in height=5in; /*identify region boundaries*/
    {code with output}
    ods region x=0in width=8in y=5.25in height=5in; /*identify region boundaries*/
    {code with output}
    ods layout end;
    

    x=horizontal starting point

    width=width of region (x+width=horizontal ending point)

    y=vertical starting point

    height=height of region (y+height=vertical ending point)