Facing issue with joinkey operation for F1 (VB file with len 80) and F2 (FB file of len 55) , when F1s 1,14 mathces with F2s 2,14 then write F2s 16,14 and f1s 15 to end of record to F1only file. (In case no match then write complete F1 record to F1ONLY.)
Output file F1ONLY need to be of lrecl and format same as F1 file.
In this same step JNF1CNTL is used to add SEQNUM of 10 bytes to F1 file
You have SYNCSORT FOR Z/OS 188.8.131.52R (MFX, which it has been officially for a while). This supports the Match Marker, "?", in the REFORMAT statement and it is much easier to use that that to mess with FILL.
Your F1 input is variable-length.
Your F2 input is fixed-length.
This gives you the choice of a variable- or fixed-length REFORMAT. You choose which best matches your output.
Your output is to be the same length and format as your F1. So making your REFORMAT variable-length is the easiest.
You do this by having, in the first four bytes of the REFORMAT, an RDW from a variable-length input file.
Then you need all your data from F1, as you may need it:
That says "from position 5 until the end of the current record". But, you also want some fixed-length data from F2, which it is best to put before the variable-length data (rather than pad the variable-length data and VLTRIM it later).
But then why do you need 55 bytes from F2 if you only use 14 of them?
And the match-marker
Then, change your SORT, as the sequence number position has changed on the REFORMAT record.
Then, why is your OUTFIL called F1ONLY? That is confusing.
Forget the IFOUTLEN, you want variable-length records.
The match-marker can have B, 1 or 2. Where B means "on both". WHEN=NONE means when no conditions are true, like an ELSE in this situation or OTHER on EVALUATE when multiple conditions. Assuming you know COBOL.
The NONE should be in your SyncSORT documentation, the match-marker probably not.