Hi All,
I am creating patient profile data where i need to place all data for one subject on same page but due to number of rows and number of columns in dataset i am not able to accomodate on same page.
I need to place data from first two dataset on first page and data from another two dataset on second page and data from last datasets on third page.
Can you please guide how can we do this ?
Regards,
Rajesh
Can you provide a sample of your data and the code you have tried so far? Fitting data on to pages is generally an exercise in adjusting font size, column label, data formatting, column widths, co-ordinates of regions, etc.
What ODS destination are you using?
And does this have to fit on actual paper or a logic page in a document? If not intended for print you can set options Papersize to a height and width that could work.
Though you my be chasing a goal that is difficult to obtain due to the nature of your data. As soon as you solve this for a patient with 100 rows of data you'll get a new one with 200 rows.
This mixing of data sets is a headache in that you either are going to get into macro coding to loop over patients and then do the output for each patient or a radical restructure of data.
Here is some pseudo code as an example of a macro approach:
%macro mix;
proc sql;
select distinct PatientID into : Patients separated by " "
from yourdatasetwithpatientids;
quit;
%let PatCount=&sqlobs; /* this will have the number of unique patient ids*/
%do i = 1 %to &Patcount;
%let pat = %scan(&patients,&i); /* patient id for this report*/
<process first data set with WHERE patientid = "&pat" or =pat depending on whether your id is character or numeric>
<process second dataset with Where on the patientid as above>
<process third dataset with where as above>
%end;
%mend;
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.