Call the sort utility from program COBOL

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Call the sort utility from program COBOL

Postby dick scherrer » Sat Jun 27, 2009 1:20 am


What I am saying is that I am developing a program able to any file types, record lenght and record type, for this the attributes are looked for at moment of processing.
Well, good luck. . .

As i mentioned previously:
What you describe does not sound like a job for a cobol program - with or without invoking the sort. . .

While i believe this could be better served with assembler or possibly by generating run-specific code and compiling "on the fly", you could use the following approach. It works, several places, but . . .

To set up a generic internal sort, you could define 10 sort keys (alternating ascending and descending) and make the data area the largest of any record you intend to support - hopefully, this process will not be intended for very large (multi-k) records. Hopefully, this will not need to deal with ODO entries either. The sort keys would be moved into the appropriate sort key field(s) and the required data would be moved in piece by piece using reference modification. The SORT statement in the program would always be the same, but the key and data content would change dynamically from run to run.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Re: Re: Call the sort utility from program COBOL





  • Related topics
    Last post