BookmarkSubscribeRSS Feed
AakashData
Calcite | Level 5

How i can remove duplicates using PROC SQL ?

4 REPLIES 4
Sathish_jammy
Lapis Lazuli | Level 10

Proc SQL;

Select distinct Column_name from Table_name;

quit;

novinosrin
Tourmaline | Level 20

Hi @AakashData  Welcome to SAS forum. 

 

When you mean duplicates, that causes ambiguity in the sense that 

1. Duplicates could mean duplicate records

2. Duplicates could mean duplicate keys. For eg: Transaction data

3. Duplicates caused due to some joins on account of one to many or more in chances of many to many

and for other various reasons in a poorly designed DIY dimensional model where dimension tables are not properly in 2nd normal form and so on and so forth.

 

It would be helpful if you could post a sample of what you HAVE explaining what you deem as duplicates and your required output. 

sandeep12
Fluorite | Level 6

To remove duplicates using PROC SQL use following step,

  1. Proc SQL noprint;
  2. Create Table inter.merged1 as
  3. Select distinct * from inter.readin ;
  4. Quit;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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