I have a REC column that can be found in three tables: GRAV, ATTRI and SIN_TOT. I want to know in the final result of this code, SAS it takes the REC column of which table exactly? knowing that there are different values between the REC column of each table.
data plafond_dos;
merge grave (in=a)
attri (in=b)
sin_tot (in=c)
;
if a;
by exer_sin anc_ref cont;
run;
See here for documentation on this topic, summarizing briefly:
bygroup any shared non-by variable will take the value of the last dataset (as they appear in themergestatement) it was read from.bygroup will implicitly retain the value from the first dataset the variable was read from.Obviously, it depends on which
bycombinations exist in each of your datasets to determine which of those will be first and last in each group.