BookmarkSubscribeRSS Feed
BStats
Calcite | Level 5

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. 

4 REPLIES 4
BrunoMueller
SAS Super FREQ

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

BStats
Calcite | Level 5

Thank you. 

BStats
Calcite | Level 5

This works but I will need to use and absolute layout. Will this not work with an absolute layout?

BrunoMueller
SAS Super FREQ

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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1733 views
  • 0 likes
  • 2 in conversation