BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mona4u
Lapis Lazuli | Level 10

 

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
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Sort descending and take the first three.

Or ascending and take the last three. 

 

 

View solution in original post

6 REPLIES 6
kiranv_
Rhodochrosite | Level 12

how ddoes output look like

mona4u
Lapis Lazuli | Level 10
 Sites_number160113501450
numsites (max 3) 776
Reeza
Super User

Sort descending and take the first three.

Or ascending and take the last three. 

 

 

Reeza
Super User

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 . 

mona4u
Lapis Lazuli | Level 10

just edit it 

jimhorne
Obsidian | Level 7

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.

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
  • 6 replies
  • 1067 views
  • 2 likes
  • 4 in conversation