Some keywords like DB/2 and AS/400 would help us find your request.
As you said, with the key from the primary file the join will compile.
But it doesn’t sort the data-it makes a keyed index into the data.
The join would generally be used as a keyed input file to RPG or Cobol. In RPG be sure to include the K on the F spec.
This type of join isn’t very good for SQL but if you are trying to do something with SQL you will have to use an ORDER BY clause.
Please tell us how you were determining that the data wasn’t in the order you needed.