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-2024.png

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.

 

Register now!

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