Data visualization with SAS programming

ODS PDF SGPLOT MACRO

Reply
Contributor
Posts: 28

ODS PDF SGPLOT MACRO

I have an example data set with 5 analytes (Analyte_a through Analyte_e).  I need to create box and whisker plots and histograms

for each of the analytes. I would like the plots to be written to a pdf file with the box and whisker plot and histogram for one analyte per page (so the

finished pdf would be 5 pages total).  I have written a macro, but it is always just one page long and it contains the plots for

the last analyte in the data set (Analyte_e).  Also, the page contains the pots for the last analyte in the list (Analytre_e), but the title in the header

is the name of the second to last analyte (Analyte_d).

-What coding do I need to add so the pdf file has one page per analyte and includes all analytes in the data set and the titles

in the header are for the correct analyte?

-The code that I have wtitten (plots.sas) and an example of the output that I have been creating (Test.pdf) are provided.

I am fairly new to writing macros; help is greatly appreciated!!

Attachment
Super User
Posts: 19,171

Re: ODS PDF SGPLOT MACRO

Try Move your ODS PDF statement before your loop starts and the ODS Close to after the loop ends.

Ask a Question
Discussion stats
  • 1 reply
  • 420 views
  • 0 likes
  • 2 in conversation