Hi,
I would like to learn how to update a target table with values from another table. There are about 1000 variables in the target table and only about 350 variables (chat or num variables) need to be updated from a renew dataset. The rules are
- If the renew dataset has value in the variables then use that value in the target dataset.
- If the renew dataset has missing value then keep the value in the target dataset.
- If both target and renew datasets have missing value then keep the value as missing.
I have generated a very simple example.
data target;
input id1$ id2 a b c$ d$ e f;
datalines;
1 10 6 8 x1 x2 9 3
2 20 5 . y1 . 6 .
;
run;
data renew;
input id1$ id2 a b c$ d$ e f;
datalines;
1 . 6 8 x10 . 9 30
2 20 . 3 . y20 6 .
;
run;
the data want will be
id1 | id2 | a | b | c | d | e | f |
1 | 10 | 6 | 8 | x10 | x2 | 9 | 30 |
2 | 20 | 5 | 3 | y1 | y20 | 6 | . |
Thank you so much.