You did not reply properly to the question asked
do You want HELP/SUGGESTIONS on a syncsort(1) or a cobol(2) solution ?
reply (1) or (2) nothing more nothing less!
You started telling that You were assigned the task of doing a file comparison in COBOL
You were given the link to a sample to do it
and it was pointed out that for proper file comparison both file had to be sorted on the compare key
just take a decision on how You want to proceed .
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort