Not to mention, there are bits where if I buy a JAL ticket for AA internationally, I get 2 free checked bags while the same AA sold and operated flight has no free checked bags. The JAL code lets the airline systems quickly determine they can't force you to pay up at the luggage drop-off because you are under the other carrier's rules for the flights.
A lot of this is based on the pre-smartphone age but I don't think there's better solutions that are both computer, person and policy friendly either.