New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
赵家钧
Fluorite | Level 6

I'm wondering if there exists any difference between NODUPKEY and  NODUPRECS options ? In my view, they seem totally the same with a BY statement.

1 ACCEPTED SOLUTION

Accepted Solutions
kiranv_
Rhodochrosite | Level 12

go through this article, it explains everything step by step with examples.

 

https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/037-30.pdf

 

View solution in original post

6 REPLIES 6
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

NODUP will delete duplicated observations (records that are identical to each other) while NODUPKEY will delete those observations that have duplicate BY values (the sort BY variables that you name in PROC SORT).

Links to SAS papers can be found here
https://communities.sas.com/t5/SAS-Programming/Difference-between-NOdup-and-NoDupkey/m-p/29490#M6614...

 

赵家钧
Fluorite | Level 6
But..... NODUPRECS option also has a BY statement. Aren't they the same?
kiranv_
Rhodochrosite | Level 12

go through this article, it explains everything step by step with examples.

 

https://support.sas.com/resources/papers/proceedings/proceedings/sugi30/037-30.pdf

 

赵家钧
Fluorite | Level 6
I think I get the answer just after reading the ABSTRACT!!! Thank you a lot! I just wrongly thought that the BY statement of NODUP can be customized depending on my needs.
Reeza
Super User
NODUPRECS has been removed from PROC SORT (documentation) but it still works for backwards compatibility. I would not recommend developing any programs that rely on the functionality of NODUPRECS today.

If you've read the paper, there are some gotcha's about it that often caught people, so they changed the functionality.
agoldma
Pyrite | Level 9

In addition to Reeza, another person from SAS Support also said that NODUPRECS has been removed from the most recent documentation (9.4) because it works in an unexpected/unreliable way.

Instead of NODUPRECS, the current suggestion is to use NODUPKEY and to sort BY _ALL_

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 31188 views
  • 14 likes
  • 5 in conversation