Hi all, I have the following two datasets I would like to merge. ID_1 CODE 10059 11 10059 36 10077 7 10077 43 10233 29 10233 31 10437 32 ID_2 CODES 10059 38 10059 41 10077 21 10077 23 10077 25 10233 29 10437 32 When merging currently using the following code: DATA Merged;
merge wave1 wave2 ; by id;
run; It comes out looking like this: id code codes 1 10059 11 38 2 10059 36 41 3 10077 7 21 4 10077 43 25 5 10077 43 23 6 10233 29 29 Whereas this is what I would like it to look like. if the two "code" columns do not match I would like them to be in separate rows. Similar to stacking the data. However if they are MATCHING, I would like them to be merged in the same row (highlighted in red). id code codes 1 10059 11 . 2 10059 . 38 3 10059 36 . 4 10059 . 41 5 10077 7 . 6 10077 . 21 7 10077 43 . 8 10077 . 25 9 10077 43 . 10 10077 . 23 11 10233 29 29 12 10233 31 . 13 10233 . 29 14 10437 32 32 Any ideas would be appreciated!
... View more