If a SORT statement appears in a section that is not an independent segment, then any input procedures or output procedures referenced by that SORT statement must appear:
If a SORT statement appears in an independent segment, then any input procedures or output procedures referenced by that SORT statement must be contained:
SORT procedures should not be invoked by multiple threads simultaneously.