• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1075
  • Last Modified:

Selecting Distinct ID's from a SAS Dataset using PROC SQL

I have a SAS dataset that has mutiple entries for an ID.  Using PROC SQL how can I select each member only one time to create a new dataset?
0
morinia
Asked:
morinia
  • 2
2 Solutions
 
SharathData EngineerCommented:
try this.
PROC SQL;
SELECT DISTINCT ID FROM Your_Table;
QUIT;

Open in new window

0
 
moriniaAdvanced Analytics AnalystAuthor Commented:
Sharath 123:

The above code works fine.  However, I do have a question if there are other fields that I would like to include that are different but I only want to print the provider one time, what would be the best approach to do this?
0
 
SharathData EngineerCommented:
If the other columns are not distinct, you will be ended up having duplicate IDs for other columns. How do you want to display result in such cases?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now