BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I'm a new sas user and find it very interesting but just don't have the luck in finding answers on the help file.

My problem is that I'm trying to use UPDATE statement to update my dataset, but it also includes the other observations w/c i don't need in my new data.

Please see sample below:

mydata1 (has 1,000 obs)
mydata2 (has 3,000 obs)

data mynewdata;
update mydata1 mydata2 UPDATEMODE=NOMISSINGCHECK|MISSINGCHECK;
by acctno;
run;


w/c results to 3,000 obs

How can I filter out (remove) the other data?

Hoping for your suggestions. Thanks
2 REPLIES 2
deleted_user
Not applicable
If you want to keep only which are in mydatset1, then you can say :

data mynewdata;
update mydata1 (in = in1)
mydata2 (in = in2);
by acctno;
if in1; /* This keeps all records in mydata1*/
run;

Hope this answers your question.
deleted_user
Not applicable
thanks shalini, i will try this

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 955 views
  • 0 likes
  • 1 in conversation