Execution of an Easytrieve program fails with error message A045 SORT TERMINATED DUE TO NON-ZERO RETURN CODE - xx
Easytrieve calls the sort package under the covers when the report definition defines a sort sequence via SEQUENCE statement
The message indicates that the sort package has failed for some reason and issued a nonzero return code
Check the messages issued by the sort package to see what is the problem.
Normally, they print to SYSOUT DD, although this may vary depending on the particular sort package and the sort options in effect.
If SYSOUT DD happens to be defined as DUMMY, the messages are lost so you'll need to rerun the job after adjusting SYSOUT DD to see the messages.
When the sort package is DFSORT and the RC is 20, this means that SYSOUT DD is missing. In this case the following message prints to JESMSGLG:
ICE158A SYSOUT DD STATEMENT MISSING
In this situation, simply adding SYSOUT DD to the JCL may clear the symptom.