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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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