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

Hello All!

I have some lines of output that are exactly the same. 

Like example 

mem id- 2. spent-$5. store-walmart. toy-barbie.

mem id- 2. spent-$5. store-walmart. toy-barbie.

Does anyone have example code to get rid of this extra line that is exactly the same?

Mary

1 ACCEPTED SOLUTION

Accepted Solutions
mohamed_zaki
Barite | Level 11

For example

Data have;
input ID Date Amount;
cards;
111 1 30
111 1 34
111 1 34
111 5 70
111 5 70
111 5 70
112 2 79
112 5 5
;
run;

proc sql ;
create table have_nodup as
select distinct *
from have
;
quit;

This is very easy one

View solution in original post

5 REPLIES 5
wilsonm3e
Fluorite | Level 6
I am still new to sas so this seems easy, but I cant seem to get rid of all them.
mohamed_zaki
Barite | Level 11

For example

Data have;
input ID Date Amount;
cards;
111 1 30
111 1 34
111 1 34
111 5 70
111 5 70
111 5 70
112 2 79
112 5 5
;
run;

proc sql ;
create table have_nodup as
select distinct *
from have
;
quit;

This is very easy one

wilsonm3e
Fluorite | Level 6

Thank you!

Reeza
Super User

If something isn't working, its helpful to post what you've tried so we know where you're trying to go with it. Also, you'll find out where the code is incorrect and needs modifications.

Reeza
Super User
  1. select distinct with PROC SQL
  2. Proc sort nodup - several options
  3. proc sort - data step with by groups

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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