Showing results for 
Search instead for 
Did you mean: 

SORT Error

Karthik Yedu Kumar
Occasional Visitor

SORT Error

Hi .. I am facing the below error in the sort routines in multiple programs ..

%COB-F-SORT_ERROR, Error during SORT or MERGE on SD
-SORT-F-SORT_ON, sort or merge routines called in incorrect order
%TRACE-F-TRACEBACK, symbolic stack dump follows

I am looking for as much info on the possible causes as possible ..


Hein van den Heuvel
Honored Contributor

Re: SORT Error

Did it ever work? What changed?
OpenVMS? (certainly looks like it :-)
Version ? Platform ? relevant Patches?

My first guess? Something wrong the definition of SYS$SCRATCH !
Perhaps it is not defined, because the program is run detached in production, interactively during test?
Perhaps pointing to an inaccessible place?

My second guess?
The program 'fell' into a sort INPUT (or OUTPUT ) PROCEDURE paragraph.

>>> SORT-F-SORT_ON, sort or merge routines called in incorrect order

Where they?
What Cobol statement caused the error?
SORT itself? A RELEASE or a RETURN ?

>>> TRACEBACK, symbolic stack dump follows

Well, does the traceback give you a clue where the program was?

If the problem persists, sprinkle the program with DISPLAYs statements to help you understand where it has been and where it tried to go.
Good Luck!
Respected Contributor

Re: SORT Error

As Hein stated, there are many possibilities. Can you post the traceback? Perhaps a code snipit around the failing Cobol statement?

We need a little more info to go on here.

Andy Bustamante
Honored Contributor

Re: SORT Error

Other things to check in the "Did this ever work" column:

Quotas against data growth and user privileges. Same user(s) or different?

If you don't have time to do it right, when will you have time to do it over? Reach me at first_name + "." + last_name at sysmanager net
John Gillings
Honored Contributor

Re: SORT Error

I think this is 2 errors. The SORT_ERROR is the one you're interested in. SORT_ON is a consequence of the previous error.

Check that PGFLQUOTA is high enough. Specificially some significant multiple of the resultant WSEXTENT for the process. Check the *actual* WSEXTENT, not the one in SYSUAF.
A crucible of informative mistakes
Richard J Maher
Trusted Contributor

Re: SORT Error

Hi Karthik,

I'm with Hein. Id look for a logic condition (or code change) that has led to a code-path where a return is coming before a release/sort.

Cheers Richard Maher

Re: SORT Error


Yes, as everybody said you need to look at the traceback information and figure out the root cause of this issue. You can also get a process dump by setting set process/dump and then look at the process dump whether any of the quota is exhausted or working set is exhausted etc.