BookmarkSubscribeRSS Feed
zimcom
Pyrite | Level 9

Hi all,

 

I want to create a bi-section report on one page with the top section being a line graph (like patient weight over the time) and bottom section being the patient Adverse Event listing so that it is easier to review if there is any relationship between weight loss or gain with the Adverse Event experienced.

 

Could someone point out the direction for me?

 

Thanks 

5 REPLIES 5
Reeza
Super User

Get something together for one version of the report and then you can generalize it. Here's a basic example of what you need to do. I would suggest first getting the code for your graphs and tables, then put them together and then automate it for everyone. 

 

UCLA introductory tutorial on macro variables and macros
https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/

Tutorial on converting a working program to a macro

This method is pretty robust and helps prevent errors and makes it much easier to debug your code. Obviously biased, because I wrote it 🙂 https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md

zimcom
Pyrite | Level 9

Thanks for your reply @Reeza 

Probably I wasn't clear, I have the program to generate the png graph by patient though ODS RTF, so the top part of Word document is the graph I need, I just want to know how to insert the listing of Adverse Events of the same patient in the bottom part of the page.

 

Dose anyone else have any idea?

Your help would be greatly appreciated!! 

Reeza
Super User
That was unclear to me for sure.
Use a PROC REPORT/PRINT and specify startpage=no on the ODS RTF statement to control when a new page is started.

ods rtf file='/folders/myfolders/demo.rtf' style=meadow startpage=no;
ods graphics / height = 3in width=5 in;
proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;

proc print data=sashelp.class;
run;

ods rtf close;
zimcom
Pyrite | Level 9

Thanks again @Reeza 

This is really helpful.I have added "By Name" in below and I am hoping that each page has the graph on top and list at the bottom (instead of all the graphs first and then followed by all the list of table). Is it doable?

 

ods rtf file='C:\Users\Yichuan Zhang\Documents\demo.rtf' style=meadow startpage=no;
ods graphics / height = 3in width=5 in;
proc sgplot data=sashelp.class;
scatter x=height y=weight;

by Name;
run;

proc print data=sashelp.class;
by Name;
run;

ods rtf close;

Reeza
Super User
No, for that type of report you need to follow the process I outlined in my tutorial, second link in my first response.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 814 views
  • 0 likes
  • 2 in conversation