BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

Do you know the script or procedure in JMP on how to remove the repeated items and still retain the row with maximum data. ie

Raw Data
Company Job Salary
ABC D 50
ABC D 60
DEF F 70
DEF G 80

Desired Output
Company Job Salary
ABC D 60
DEF G 80

Thanks,
Phil
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Here's one SAS programming approach using only SORT to generate the result you showed:

data ;
input Company $ Job $ Salary ;
datalines;
ABC D 50
ABC D 60
DEF F 70
DEF G 80
run;
proc sort ;
by company descending salary;
run;
proc sort nodupkey equals ;
by company ;
run;
options nocenter;
proc print u noobs;
run;

Scott Barry
SBBWorks, Inc.
Alankar
Fluorite | Level 6
Hi Scott,

Good Answer.
I've a small Question.
Actually in Proc Sort what is the functionality of "Equals","Noequals".
In which conditions we need to use those options?

Thanks,
Alankar
Cynthia_sas
SAS Super FREQ
Hi:
The documentation talks about it in great detail:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000146878.htm

in short:
EQUALS: Maintain relative order within BY groups
NOEQUALS: Do not maintain relative order within BY groups

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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