When MFX is initiated from a COBOL program, the calling program handles I/O, remains in storage, and generally retards sort execution. MFX will yield maximum performance through proper synchronization of all data whenever it has control of the sorting process, i.e., whenever // EXEC PGM= SYNCSORT is used.
From the point of view of performance, the JCL-initiated sort execution has the advantage. Whenever possible, tasks incidental to the sort/merge/copy process should be handled via MFX control statements. Where this is not possible, the JCL/control stream should be supplemented with user-written exit routines. Ideally, the exit routines exist as load modules, so that they do not require link-editing every time the job is run. MFX permits exit routines to be written in COBOL, C, FORTRAN, REXX, or Assembler language.
If you must invoke the sort from a COBOL program, you may improve sort performance by passing an accurate FILSZ=n/En parameter via $ORTPARM.