BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ybz12003
Rhodochrosite | Level 12

Hi all,

 

I would like to print out a report by grouping studysites for a dataset 'test'.   I have a code below.  However, I found out that the output file was order by studysite, it print out the studysite and the IDs one by one.   I don't like that, I would like to out put the file with grouping the studysite first, then sorting the IDs later.  I found there is no 'GROUP' option in the PROC PRINT,  please advice how to approach it?  Thanks.

 

options orientation=portrait;
proc print data=test;
	var id repeat_id studysite DOB months days;
	where repeat_id in (&replistdob.);
	by studysite repeat_id;
	title 'More than 1 dob for a repeat ID';
run;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I would like to out put the file with grouping the studysite first, then sorting the IDs later.


use by studysite; instead of by studysite repeat_id;

 

 

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I would like to out put the file with grouping the studysite first, then sorting the IDs later.


use by studysite; instead of by studysite repeat_id;

 

 

--
Paige Miller
ybz12003
Rhodochrosite | Level 12
Thanks!

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 419 views
  • 0 likes
  • 2 in conversation