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

1) I have a dataset A (having millions of records) in LASR library. 

2) Importing B file with few hundred rows.

3) Need to compare A and B and delete common records from A (lasr library) without creating a temporary copy.

 

Solution:

Using imstat statement--(not working)

 

proc imstat data=LASRLIB.A;
merge LASRLIB.A (in=a)
                  B    (in=b);
if a and b;
run;
deleterows / purge; 
run;

 

(Note: Merge not working with proc imstat.)

 

 

Is there any other way to do it?

1 ACCEPTED SOLUTION

Accepted Solutions
jitinsethi07
Obsidian | Level 7

Got the solution!

 

Storing all unique values in macro variable and passing in where clause of proc imstat.

 

proc imstat = lasrlib.A;

where column = &macro;

run;

deleterows / purge;

run;

View solution in original post

1 REPLY 1
jitinsethi07
Obsidian | Level 7

Got the solution!

 

Storing all unique values in macro variable and passing in where clause of proc imstat.

 

proc imstat = lasrlib.A;

where column = &macro;

run;

deleterows / purge;

run;

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1120 views
  • 1 like
  • 1 in conversation