Hello SAS Communities,
How can I get the following report to be produced on one page instead of two?
ODS PDF FILE = "&CourseRoot/Documents/Test.pdf";
PROC REPORT DATA = Results.ChiSqResults;
COLUMN Statistic
("Statistical Results" DF Value Prob);
DEFINE Statistic / 'Test';
DEFINE Prob / 'P-Value';
FORMAT Value 4.2
Prob 4.2;
RUN;
PROC PRINT
DATA = Results.ANOVAResults
SPLIT = '/'
OBS = '/Variable';
LABEL
Dependent = 'Variable/Name'
FValue = 'F/Statistic'
ProbF = '/P-Value';
RUN;
ODS PDF CLOSE;
Hello! I believe you just need to use an ODS PDF statement option: STARTPAGE=NO
You can place the following statement after your first run statement (in the PROC REPORT step) as follows:
ODS PDF FILE = "&CourseRoot/etc;
TITLE1 "Chi-Square Test of Independence Results";
PROC REPORT DATA = XXX;
COLUMN Statistic
("Statistical Results" DF Value Prob);
DEFINE Statistic / 'Test';
DEFINE Prob / 'P-Value';
FORMAT Value 4.2
Prob 4.2;
RUN;
ODS PDF STARTPAGE=NO;
TITLE1 "Analysis of Variance Results";
PROC PRINT
DATA = YYY
SPLIT = '/'
OBS = '/Variable';
LABEL
Dependent = 'Variable/Name'
FValue = 'F/Statistic'
ProbF = '/P-Value';
RUN;
ODS PDF CLOSE;
Once you open the new PDF the 2 data sets will be on the same page.
Hope this helps!
Mady
Good evening,
This sounds like a situation where you will have to use ODS tagsets. This will require you to define page panels, place individual proc statements in specific panels, and then close panels as you move down the page. I have never done it before, but here is a great reference I found!
https://www.lexjansen.com/pharmasug/2009/tt/TT11.pdf
Hope this helps!
Hello! I believe you just need to use an ODS PDF statement option: STARTPAGE=NO
You can place the following statement after your first run statement (in the PROC REPORT step) as follows:
ODS PDF FILE = "&CourseRoot/etc;
TITLE1 "Chi-Square Test of Independence Results";
PROC REPORT DATA = XXX;
COLUMN Statistic
("Statistical Results" DF Value Prob);
DEFINE Statistic / 'Test';
DEFINE Prob / 'P-Value';
FORMAT Value 4.2
Prob 4.2;
RUN;
ODS PDF STARTPAGE=NO;
TITLE1 "Analysis of Variance Results";
PROC PRINT
DATA = YYY
SPLIT = '/'
OBS = '/Variable';
LABEL
Dependent = 'Variable/Name'
FValue = 'F/Statistic'
ProbF = '/P-Value';
RUN;
ODS PDF CLOSE;
Once you open the new PDF the 2 data sets will be on the same page.
Hope this helps!
Mady
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.