Hi, I would like to do Match Merge 2 datasets of different variables. Currently when I use the BY statement, any missing values are retained from last value for the match. That creates lot of duplicates. DATA_A : BOAVTS01 E082 E08 BOAVTS01 E242 E24 BOAVTS01 E282 E28 BOAVTS01 4102 F20 BOAVTS01 E522 F52 BOAVTS01 E102 G10 BOAVTS01 E302 G30 TXSVTS30 3302 1G TXSVTS30 3002 3S TXSVTS40 3302 1G TXSVTS40 3002 3S DATA_B; BOAVTS01 UKDUKC01 BOAVTS01 UKDUKC02 BOAVTS01 UKDUKC03 BOAVTS01 UKDUKC04 TXSVTS30 KCDTXS36 TXSVTS30 KCDTXS38 TXSVTS30 TXDVTS35 TXSVTS30 TXDVTS37 TXSVTS40 KCDTXS44 TXSVTS40 KCDTXS46 TXSVTS40 TXDVTS43 TXSVTS40 TXDVTS45 DATA DATA_C ; MERGE DATA_A DATA_B ; BY COMPLIB ; My current output: BOAVTS01 E082 E08 UKDUKC01 BOAVTS01 E242 E24 UKDUKC02 BOAVTS01 E282 E28 UKDUKC03 BOAVTS01 4102 F20 UKDUKC04 BOAVTS01 E522 F52 UKDUKC04 BOAVTS01 E102 G10 UKDUKC04 BOAVTS01 E302 G30 UKDUKC04 TXSVTS30 3302 1G KCDTXS36 TXSVTS30 3002 3S KCDTXS38 TXSVTS30 3002 3S TXDVTS35 TXSVTS30 3002 3S TXDVTS37 TXSVTS40 3302 1G KCDTXS44 TXSVTS40 3002 3S KCDTXS46 TXSVTS40 3002 3S TXDVTS43 TXSVTS40 3002 3S TXDVTS45 When i do the above code to merge the output is like this which is ugly like below: The missing values are assigned as the last value on the BY variable. The last observation of the by variable is repeating for the missing values. How to avoid that ? i want the missing values to be considered as missing rather than taking last observation. Any inputs are much appreciated: My desired output: BOAVTS01 E082 E08 UKDUKC01 BOAVTS01 E242 E24 UKDUKC02 BOAVTS01 E282 E28 UKDUKC03 BOAVTS01 4102 F20 UKDUKC04 BOAVTS01 E522 F52 . BOAVTS01 E102 G10 . BOAVTS01 E302 G30 . TXSVTS30 3302 1G KCDTXS36 TXSVTS30 3002 3S KCDTXS38 TXSVTS30 . . TXDVTS35 TXSVTS30 . . TXDVTS37 TXSVTS40 3302 1G KCDTXS44 TXSVTS40 3002 3S KCDTXS46 TXSVTS40 . . TXDVTS43 TXSVTS40 . . TXDVTS45 Thank you, Sathish
... View more