OK, I've got more time, so here's my attempt:
I've done it just as a plain SORT with JOINKEYS. There is a presumption that both files are to be sorted in the join, but that is not relevant to the solution.
The idea is to "concatenate" a "999999999999" record to each input dataset (INA and INB).
If the main file for INB is empty, INB will only contain that 999999999999 record.
In this case, the only match you will get will be the 999999999999 record, so that is what will be on your output.
In the case of records on INB which match, the trick is then to avoid writing the 999999999999 record as it is not needed when there is data.
This is achieved by appending a sequence number to each record. This will never appear on the output file, because the IFOUTLEN=80 will cut it off as the records are written.
When the 999999999999 record is reached, the sequence number is tested. If not 00000001, the 999999999999 is "marked" for exclusion, I have in this example put an "O" (letter "O") in place of the final digit.
The unwanted 99999999999O record is then OMITted with OUTFIL.
//STEPEMPT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
//INA DD *
//INB DD *
Output from the above,
Output with this for INB
I've used my own data and positions for testing, but you should be able to apply it to your requirement if necessary.