Hi,
My company is having me convert some quartly reports that are currently being run by SQL into SAS stored processes. I found a macro on a differnet community board that shows how to "glue" or stack your proc report output on top of each other, so it appears as if it is a single table. The article is here http://www2.sas.com/proceedings/sugi31/089-31.pdf. However, we need to use ods layout, which requires ods pdf, to get everything to fit on a single page. Does anyone know how to get this stacked table appearance using ods pdf?
I guess another question would be, can ods layout allow me to get the tables close enough together so that they appear as one single table?
Really any help is wanted.
Thank you.
You can use ODS LAYOUT to do what you want. You just set the ROW_GUTTER=0, this should give you what you want.
Find below a sample code, make sure all the output fits on one page.
ods _all_ close;
options nocenter;
ods pdf file="c:\temp\sample.pdf" ;
ods layout gridded columns=1 row_gutter=0;
ods region;
proc print data=sashelp.class;
where sex = "F";
run;
ods region;
proc print data=sashelp.cars(obs=15);
var make model type invoice Horsepower;
run;
ods region;
proc print data=sashelp.class;
where sex = "M";
run;
ods layout end;
ods pdf close;
Bruno
Thank you.
This works but I will need to use and absolute layout. Will this not work with an absolute layout?
You can use absolute layout, but this means you have to know exactly the size of the region, that you are going to use, that will work with your data. If the region is too small, you will get a warning in the log, and region is not filled.
Sample code below shows how to use it.
ods _all_ close;
options nocenter;
ods pdf file="c:\temp\sample.pdf";
ods layout absolute;
%let tableHeight=6.63cm;
ods region x=0 y=0 width=8cm height=&tableHeight;
proc print data=sashelp.class
style(table) = {width=100pct}
;
where sex = "F";
run;
ods region x=0 y=&tableHeight width=8cm height=10cm;
proc print data=sashelp.class
style(table) = {width=100pct}
;
where sex = "M";
run;
ods layout end;
ods pdf close;
Bruno
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.