Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with INDEXES ASAP 2

Status
Not open for further replies.

sudhakode

Programmer
Mar 28, 2006
5
US
Hi,
I have an indexed SAS dataset. I want to find out if there is a way to remove the duplicate obs on this dataset by retaining the index on the dataset or without disturbing the SAS dataset.

data x(index = (trk = (a b)));
input a b c;
cards;
1 2 3
1 2 3
3 4 5
5 6 7
5 6 7
;
run;

I want to modify this dataset DS with the index "trk" retained and deleting the dup obs on a,b,c variables.
i.e., my new dataset DS should look like this with the index TRK as it. I shouldn't recreate this index once the dups are removed. Duplicate obs should be removed from the indexed dataset.

New dataset:
a b c
1 2 3
3 4 5
5 6 7

Any help would be really appreciated.
Thanks.
Sudha

 
Hello,

You can try this piece of code.

data x(index = (trk = (a b)));
input a b c;
cards;
1 2 3
1 2 3
3 4 5
5 6 7
5 6 7
;
run;

proc sql ;
create table test(a num unique,b num unique,c num);
describe table test;
quit;

proc append base=test data=x ;
run;

It will work.

Good Luck.

Suchismita.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top