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

hi,

Does anyone know if it is possible to export a frequency table, and histogram onto a same PDF page?

 

Here is the code I use to produce distinct pdf files.

Thanks in advance,

 

 

ds pdf file="&drop.&title._&dtfrom._to_&dtto..PDF";
ods pdf StartPage=Never; 
ods noproctitle; 
TITLE1 "Ratio of Voluntary Account Closures";
proc FREQ data=a_pdf ;
TABLES Voluntary_Closure_Reason /norow nocol ; 
RUN; 
ods pdf close; TITLE1 ; 

ods pdf file='file.pdf';
PROC SGPLOT DATA=b;
VBAR Voluntary_Closure_Reason /
RESPONSE = COUNT;
TITLE 'Status Additions';
RUN; 
ods pdf close; 
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

A lot of things will go into the determination of pagination besides the startpage option. If the table is long then there may not be any room for the graph. Or the size options for you graph may want more space and not fit with a small table.

This works for me as an example:

 

ods pdf file="d:\test.PDF" style=meadow;
ods pdf StartPage=Never; 
ods noproctitle; 

TITLE1 "Ratio of Voluntary Account Closures";
proc FREQ data=sashelp.class (obs=5) ;
   TABLES name /norow nocol ; 
RUN;
 
PROC SGPLOT DATA=sashelp.class (obs=5);
   VBAR name /
   RESPONSE = Height;
   TITLE 'Status Additions';
RUN; title;
ods pdf close; 

Note that if you ever close the PDF with the ODS PDF Close anything that follows will likely not be in the same document much less page.

 

I used style meadow as it uses a smaller font than the default PDF wants and makes the table smaller.

View solution in original post

3 REPLIES 3
ballardw
Super User

A lot of things will go into the determination of pagination besides the startpage option. If the table is long then there may not be any room for the graph. Or the size options for you graph may want more space and not fit with a small table.

This works for me as an example:

 

ods pdf file="d:\test.PDF" style=meadow;
ods pdf StartPage=Never; 
ods noproctitle; 

TITLE1 "Ratio of Voluntary Account Closures";
proc FREQ data=sashelp.class (obs=5) ;
   TABLES name /norow nocol ; 
RUN;
 
PROC SGPLOT DATA=sashelp.class (obs=5);
   VBAR name /
   RESPONSE = Height;
   TITLE 'Status Additions';
RUN; title;
ods pdf close; 

Note that if you ever close the PDF with the ODS PDF Close anything that follows will likely not be in the same document much less page.

 

I used style meadow as it uses a smaller font than the default PDF wants and makes the table smaller.

brulard
Pyrite | Level 9
Appreciate the explanation.

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