This is a good task to take advantage of the default attributes of hash object (hash table).
The data step below declares a hash table with 2 variables (ID1_A and ID2_B), keyed on ID1_A. Because the default mode of hash tables is to keep only one item (i.e. one row) per key (one per ID2_B in your case), and that one item defaults to the first one encountered, you can just output the hash object to a sas dataset to get what you want, namely each ID2_B and the earliest associated ID1A.
data _null_;
declare hash h (dataset:'have (keep=id1_a id2_b)');
h.definekey('id2_b');
h.definedata(all:'Y');
rc=h.output(dataset:'decoder');
run;
proc sort data=decoder;
by id1_a id2_b;
run;
... View more