|
As a previous poster mentioned, MERGE instead of UPDATE may be helpful
... but not if you have many transactions per ID.
UNTESTED: I believe that UPDATE respects special missing values. This
combination might work:
data trans;
set trans;
array nums {*} _numeric_;
do i=1 to dim(nums);
if nums{i}=. then nums{i}=.R;
end;
drop i;
run;
data master;
update master trans;
by ID; /* assuming they are sorted */
array nums {*} _numeric_;
do i=1 to dim(nums);
if nums{i}=.R then nums{i}=.;
end;
drop i;
run;
A couple of notes. First, you don't have to apply this to ALL numerics
in the transaction file. It's perfectly all right to pick and choose
which should take on a special missing value. And to make this happen
for character variables, you might have to come up with your own version
of a special missing value for character values, such as "_" or "!".
Whatever character you choose, make sure it's only one character long,
because some character variables in the master file might be only one
character long.
Bob V.
|