BookmarkSubscribeRSS Feed
draroda
Fluorite | Level 6

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

2 REPLIES 2
nehalsanghvi
Pyrite | Level 9

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.

ballardw
Super User

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;

 

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 655 views
  • 0 likes
  • 3 in conversation