I assume that the first dataset in the SET statement was the one with the
glitch in the length? If so, this is no bug, SAS is behaving as expected.
On the SET, it will determine the length of variables from the length in
the first dataset. Then, each of the other datasets will see the variable
truncated to the length in the first (when the lengths differ).
The easiest fix is to ensure correctness of the dataset structure,
alternatively, to ensure that these read correctly if for some reason you
have to have different lengths in the input datasets, just put
length <variablename> $ 10 ;
before the SET statement.
On the other hand, if the first dataset in the SET is not the one with the
incorrect length ....