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;
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.
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.
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!
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.