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

I would like to remove original and duplicates from that dataset. so finally i will get unique records .

1

2

1

2

3

my output should contain only 3. 

 

Note : i mentioned only one column but i have several columns. please someone help me on this

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20
proc sql;
 create table uniques as
 select *
 from your_table
 group by id_variable
 having count(id_variable)=1;
quit;

View solution in original post

4 REPLIES 4
novinosrin
Tourmaline | Level 20
proc sql;
 create table uniques as
 select *
 from your_table
 group by id_variable
 having count(id_variable)=1;
quit;
rajeshm
Quartz | Level 8

Thanks a lot for quick  solution.

 

 

PeterClemmensen
Tourmaline | Level 20

What is the logic when you more than one variable? What if your dataset looks like this?

 

data have;
input x y;
datalines;
1 3
2 1
1 2
2 1
3 2
;
rajeshm
Quartz | Level 8

Output should be like this (records should be deleted 2 1 )

1  3

1  2

3  2

 

1 3
2 1
1 2
2 1
3 2

 

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!

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