BookmarkSubscribeRSS Feed
brm
Calcite | Level 5 brm
Calcite | Level 5
Hi,

I trying to keep duplicate records in sepate dataset.I' doing it like this,but having problem with large data.Can anybody suggest how can i do this in other
way.

proc freq data = b noprint ;
/*by DRC_CASE_ID Milestone_Date Product MILESTONE_TYPE ;*/
table DRC_CASE_ID*Milestone_Date*Product*MILESTONE_TYPE*DAYS_OF_THERAPY / out =
test18(drop=percent where = (Count >1));
run;

ERROR: The requested table is too large to process.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 219548 observations read from the data set WORK.B.

Thanks,
brm
2 REPLIES 2
Patrick
Opal | Level 21
data have;
a=1;b=1;c=1; output;
a=1;b=2;c=1; output;
a=2;b=2;c=1; output;
a=1;b=2;c=1; output;
a=1;b=2;c=1; output;
run;

/* for duplicates: Keeps the first rec in want1, moves all other recs to DupsWant1 */
proc sort data=have out=want1 dupout=DupsWant1 noduprec;
by a b c;
run;


/* Creates a table with duplicates, a table with all obs having no duplicates, and a table with all de-duped obs */
proc sql;
create table Duplicates as
select *, count(*) as N_Dups
from have
group by a,b,c
having count(*)>1
;

create table ObsWithNoDuplicates as
select *
from have
group by a,b,c
having count(*)=1
;

create table AllObsDeDuped as
select DISTINCT *
from have
;

quit;


HTH
Patrick
brm
Calcite | Level 5 brm
Calcite | Level 5
Thanks a lot....those worked fine for me.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 4173 views
  • 0 likes
  • 2 in conversation