BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NikitaTovey
Fluorite | Level 6

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;

1 ACCEPTED SOLUTION

Accepted Solutions
mady3
Fluorite | Level 6

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

View solution in original post

3 REPLIES 3
rhaley1821
Obsidian | Level 7

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! 

mady3
Fluorite | Level 6

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

NikitaTovey
Fluorite | Level 6
Thank you!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1565 views
  • 2 likes
  • 3 in conversation