BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10

Hi Guys,

how to remove duplicate values using proc summary and proc tabulate give example 

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

Why do you want to use either of those to remove duplicates in your data?

BrahmanandaRao
Lapis Lazuli | Level 10
for best practice
Kurt_Bremser
Super User

Best practice is to use PROC SORT with NODUPKEY, a DATA step with FIRST. or LAST., or SQL with DISTINCT, depending on your data structure and the details of your needs.

(PS if that was an interviewer's question, he/she wants the above as answer; the fact that you even think about trying such stupidity during an interview immediately exposes you as a SAS noob).

ballardw
Super User

@BrahmanandaRao wrote:

Hi Guys,

how to remove duplicate values using proc summary and proc tabulate give example 


Proc SUMMARY summarizes numeric values and could be done so for groups of BY or Class variables. Not really removing duplicates.

Proc tabulate by default creates a report for people to read and removes nothing and the output data sets created by Proc tabulate are structured quite a bit differently than you might expect, not a good tool for "removing duplicates" in my opinion but useful for certain restructuring issues. Additionally since Proc Tabulate can have multiple Table descriptions in a single procedure the output data set can be quite complicated.

 

So a very explicit detailed example of starting data and desired result are needed to properly answer a question.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1297 views
  • 1 like
  • 4 in conversation