Sounds like you are trying to do a MANY to MANY merge. When you have a BY group with N observations from one dataset and M observations from the other you will get MAX(N,M) observations out. The variables that only exist in the dataset with the fewer number of observations for the group will retain the value from the last observation contributed by that dataset, since SAS does not have anything more to read from that dataset to change the values.
Note that the same thing happens in a one to many merge, but it is more likely that actually want the values of the variables that only exist in the dataset with only one observation in the group copied onto every resulting observation.
What output do you want to get?
Is there another variable to BY statement so that you no longer have a many to many merge? So that your merge is either one to one or one to many.
If you want to get N x M observations output instead then use PROC SQL.
If you the short dataset to stop contributing data you can add a couple of statements to your data step.
data mergedd;
merge One (RENAME=(Company=Company1 Cost=Cost1))
Two (RENAME=(Company=Company2 Cost=Cost2))
;
by Size;
output;
call missing(of _all_);
run;