Merge 2 files with a key and insert a blank line if key changes.
Both files have same layout and PS, LRECL=80.
Key length is 9, STARTPOS= 12.
Key is repeatable in both files. Both input files are already sorted by the key. It is not necessary that key in INPUT-FILE1 file always has matching records in INPUT-FILE2 and vice versa.
I know this can be done using SORT-JOINKEYS. But I don't know how to write it. When refering few topics here, some code like below will do; but I dont know what to write in JNF1& JNF2 control cards and how to insert blank lines.
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
Better approach would be to use MERGE instead of JOINKEYS. Your input is already sorted, so only the OUTFIL SECTIONS is required after the merge. The result from my test:
Thank you Joerg.Findeisen for working on my request. BTW you posted the result (looks good), but not the SORTCARD that you have used. Please post SORTCARD also, that is very useful to me.
FYI. I started learning JOINKEYS, SECTIONS, SPLICE etc.
Always search before posting and try with closest solution you find and then post if it still not working.
Joerg may have not given ready solution purposely to let you try.
See here is the link to how it’s done. Trailer will add spaces once key changes in sections and now you can get it to work.
ibmmainframes.com/about60093.html
Thank you Joerg.Findeisen for working on my request. BTW you posted the result (looks good), but not the SORTCARD that you have used. Please post SORTCARD also, that is very useful to me.
FYI. I started learning JOINKEYS, SECTIONS, SPLICE etc.
Much more useful for you would be: learning how to do your own job, not only how to use the result of others workas if it was done by yourself.