It will update the table A only if there is a row in the table B with
TAB_B_COL2 = 'XYZ'.
If you remove the EXISTS clause, then it will update table A even if there is no row in table B with TAB_B_COL2 = 'XYZ'
The above query could be split into 2 simple SQL. I It would help to do existence check first. If it exists, then do UPDATE on TABLE_A
SELECT DISTINCT TAB_B_COL1
SET TAB_A_COL1 =: WS-TAB-B-COL1
One more recommendation could be for first SQL in my response.
If you think that you are going to get only one value (but it contains duplicate rows) for column TAB_B_COL1 from TABLE_B for a given condition, you can use FETCH FIRST ROW ONLY instead of using DISTINCT. It would help to avoid internal SORT for DISTINCT.
FETCH FIRST ROW ONLY