Help using Base SAS procedures

Dedupping by priority when multiple rows share the same priority

Reply
Occasional Contributor
Posts: 12

Dedupping by priority when multiple rows share the same priority

Hello,

 

I have a data set which I've given values in a column called priority.  How can I dedup so that I keep those with the lowest value for priority?  For example below, I would want to keep the value where priority = 1 and delete any other priorities.


priority example.JPG

 

 

Thanks,

-Matt

Super User
Posts: 13,498

Re: Dedupping by priority when multiple rows share the same priority

In a data step:

 

Data want;

    set have;

    where priority=1;

run;

 

will keep only records with the stated priority value. If the value is character then it would have the value inside quote marks.

 

 

Ask a Question
Discussion stats
  • 1 reply
  • 104 views
  • 0 likes
  • 2 in conversation