okay, i assume this should be a simple solution that i am just not coming up with but...i am new to sas reporting so i have two very large tables i am looking into creating a report for. the reports are basicallly a summation of two variables grouped by a different variable for each report. i have already built tables of the data i want on the report. what i would like is to create a single pdf report with multiple tables & titles on it. so it would look something like this...
pdf start
title 1
proc sql;
select *
from table1;
quit;
title 2
proc sql;
select *
from table2;
quit;
...4 more tables...
footnote...
end pdf
i would think this is possible but for some reason i keep getting a page break in between. it does not have to be proc sql pulling the data also.
Have you tried the startpage=no option in your code?
ods pdf file='path' startpage=no;
<different procedures>
ods pdf close;
that was part of it, i was putting the startpage=no in the wrong spot. here is the code i am using...
data _null_ NOPRINT;
today1=put(date(),worddate18.);
today2=put(date(),YYMMDD10.);
call symput('worddate',today1);
call symput('numdate',today2);
run;
ods pdf file="test.pdf" startpage=no;
options label;
title "Test Reporting";
Footnote Generated by &_CLIENTUSERNAME with SAS Enterprise Guide &_CLIENTVERSION on &worddate;
proc report data=RPT01 split="~" spanrows;
title1 'report 01';
column SOURCE AmtA AmtB;
run;
title1;
proc report data=RPT03 split="~" spanrows;
title2 'report 03';
column SOURCE AMT1 AMT2;
run;
title2;
title;
ods pdf close;
ods listing;
now however, i do not get the title inbetween. this does stack the reports on the pdf but does not put a title inbetween like i need to explain the output...
The ODS PDF destination allows for one title on a page. If there is a second output that begins on the same page, there is no new title.
See this thread for a way to add "titles".
I've had this issue before, too. One workaround is to use ODS TEXT in the body of the report to add a title in the page. The TITLE statements are not that flexible and you can use ODS TEXT ='SAMPLE TITLE HERE' ; above your PROC REPORT code to insert text where you want it to go.
@svh wrote:
I've had this issue before, too. One workaround is to use ODS TEXT in the body of the report to add a title in the page. The TITLE statements are not that flexible and you can use ODS TEXT ='SAMPLE TITLE HERE' ; above your PROC REPORT code to insert text where you want it to go.
Or Proc ODSTEXT which allows a little more flexibility in some ways than ODS text and does not create table output.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.