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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 3932 views
  • 0 likes
  • 2 in conversation