Thanks for the clarification.
From the sample date you have shown, the key on the File 2 is in the same position as the File 1, so that needs to change.
You are showing your sample data as already being in key order. If that is the case, add SORTED,NOSEQCK to each of the JOINKEYS for whose file that is true (else the JOINKEYS will cause the file to be sorted again, wasting resources).
On the JOIN statement you have UNPAIRED,F1,F2,ONLY. That will get all unmatched records on F1 and all unmatched records on F2 and no other records. You want matched records, which you get with every JOIN which does not specify ONLY, and you don't want unmatched F2 records.
If data is consecutive in a BUILD (not "gaps" for automatic space-padding) it only confuses to specify column numbers.
There are only two pieces of data you need from File 2, the key, and the data you want to add. So you can use JNF2CNTL to limit the data from your File 2 for the join (reducing resource use).
For an unmatched record in the REFORMAT statement, data fields contain space (unless you specify a different FILL character), so nothing big you need to do with that.
JOINKEYS FILES=F1,FIELDS=(1,9,A),SORTED,NOSEQCK
JOINKEYS FILES=F2,FIELDS=(1,9,A),SORTED,NOSEQCK
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,09,F2:62,1)
OPTION COPY
OUTFIL FILES=01,
BUILD=(1,3,
C',',
4,6,
C',',
10,1,
C',')
That is your basic code. The JOIN statement will give you matched records, and unmatched F1 records. Where you are unmatched F1 records, the F2 data will be blank.
If you cut down on the amount of data to be processed from File 2:
,SORTED,NOSEQCK
//JNF2CNTL DD *
INREC BUILD=(1,9,62,1)
Then change the REFORMAT statement:
REFORMAT FIELDS=(F1:1,09,F2:10,1)
You could look at using Sort Symbols on a SYMNAMES dataset, with a SYMNOUT as well, to specify a symbol for the comma. Then instead of three separate literals of the same value, you'd have one symbol with one value used three times. Makes changing things in the future easier and more accurate.