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

Hi guys,

 

I have a table with many records per id.  I want one record just of each id variable.  I have tried different combinations of this, and nothing is working.  I end up with exactly the same number of records as the table going into the sort.

 

?!?!?

 

proc sort data=junk.new_costs_&yr._filtered nodup out=junk.npats (keep=usrds_id); by usrds_id; run;

 

proc sort data=junk.new_costs_&yr._filtered out=junk.npats (keep=usrds_id) nodup; by usrds_id; run;

 

proc sort data=junk.new_costs_&yr._filtered nodup (keep=usrds_id)  out=junk.npats; by usrds_id; run;

 

 

15       !  proc sort data=junk.new_costs_&yr._filtered nodup out=junk.npats (keep=usrds_id); by usrds_id; run;

NOTE: There were 41013989 observations read from the data set JUNK.NEW_COSTS_2014_FILTERED.
NOTE: 0 duplicate observations were deleted.
NOTE: The data set JUNK.NPATS has 41013989 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           21:43.46
      cpu time            1:21.97

 

 

Thanks

Megan

1 ACCEPTED SOLUTION

Accepted Solutions
MeganE
Pyrite | Level 9

Nevermind, i got it.  nodupkey worked.  In pretty much any order

View solution in original post

1 REPLY 1
MeganE
Pyrite | Level 9

Nevermind, i got it.  nodupkey worked.  In pretty much any order

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
  • 1 reply
  • 1127 views
  • 0 likes
  • 1 in conversation