Help using Base SAS procedures

HELP: update dataset problem

Reply
N/A
Posts: 0

HELP: update dataset problem

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
N/A
Posts: 0

Re: HELP: update dataset problem

Posted in reply to deleted_user
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.
N/A
Posts: 0

Re: HELP: update dataset problem

Posted in reply to deleted_user
thanks shalini, i will try this
Ask a Question
Discussion stats
  • 2 replies
  • 98 views
  • 0 likes
  • 1 in conversation