The SAS Output Delivery System and reporting techniques

max 3

Accepted Solution Solved
Reply
Regular Contributor
Posts: 165
Accepted Solution

max 3

[ Edited ]

 

I have this dataset and I want to create a report that include the max 3 of numsites. I tried proc univariate but the problem is it gonna include the highest and the lowest in the output and I couldn't find option that exclude the lowest . 

Please advise me what is the best way to get the result.  

 

 

ObsSite_Numbernumsites
110501
212002
313507
414506
514514
616002
716017
816023
950064
1050081

Accepted Solutions
Solution
‎02-21-2018 02:23 PM
Super User
Posts: 24,003

Re: max 3

Sort descending and take the first three.

Or ascending and take the last three. 

 

 

View solution in original post


All Replies
PROC Star
Posts: 549

Re: max 3

how ddoes output look like

Regular Contributor
Posts: 165

Re: max 3

 Sites_number160113501450
numsites (max 3) 776
Solution
‎02-21-2018 02:23 PM
Super User
Posts: 24,003

Re: max 3

Sort descending and take the first three.

Or ascending and take the last three. 

 

 

Super User
Posts: 24,003

Re: max 3

Is that what you have? What would be the expected output for that data?

 

Your requirements are not clear, no idea what the following means

 

I tried proc univalent but the problem is it gonna include the highest and the lowest in the output and I couldn't find option that exclude the lowest . 

Regular Contributor
Posts: 165

Re: max 3

just edit it 

Contributor
Posts: 22

Re: max 3

You could investigate PROC RANK and merging its results back with your original data if you want to do a little programming so the computer can reproduce it at will.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 192 views
  • 2 likes
  • 4 in conversation