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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 1532 views
  • 2 likes
  • 3 in conversation