Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PC Sort Utilities

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,312
US
I was wondering what kind of PC Sort utilities are out there (that function similarly to DFSORT/Syncsort) - specifically if a measure of performance is out there regarding how fast they work in a certain situation.
Anything where a demo can be downloaded is useful.
 
Many of the COBOL compiler vendors provide SORT utilties. I have heard for requests (particularly of Micro Focus) for "DFS/ort" (or SyncSort) control card capabilities, but I don't know if any vendor has provided this.

Bill Klein
 
it is not so difficult to write your own sort in COBOL, so why would you buy them?

EXAMPLE:

Code:
001400 IDENTIFICATION DIVISION.
001500 PROGRAM-ID. SORTDEMO.
001600 ENVIRONMENT DIVISION.
001700 CONFIGURATION SECTION.
001710 SOURCE-COMPUTER. IBM-PC.
001720 OBJECT-COMPUTER. IBM-PC.
001730 SPECIAL-NAMES.
001740     DECIMAL-POINT IS COMMA.
001800 INPUT-OUTPUT SECTION.
001900 FILE-CONTROL.
002100       SELECT SORTINPUT
002210          ASSIGN TO 'ADRES.TXT'.
002300       SELECT SORTOUTPUT
002410          ASSIGN TO 'ADRES2.TXT'.
002500       SELECT SORTFILE
002700          ASSIGN TO 'SORTFILE.TXT'.
002800 DATA DIVISION.
002900 FILE SECTION.
003100 FD SORTINPUT LABEL RECORDS STANDARD.
003200 01 I-SORTREC         PIC X(96).
003400 FD SORTOUTPUT LABEL RECORDS STANDARD.
003510 01 O-SORTREC         PIC X(96).
003700 SD SORTFILE.
003810 01 SORTREC           PIC X(96).
003910 WORKING-STORAGE SECTION.
004000 01  SYSTEEM-TIME-CASES.                                                  
004010     03  THE-TIME                PIC 9(8).
004020     03  DISP-THE-TIME           PIC 99.99.99.99.
004100 PROCEDURE DIVISION.
004200 0000.
004220     PERFORM DISPLAY-THE-TIME.
004300     SORT SORTFILE ON ASCENDING KEY SORTREC
004400     USING SORTINPUT GIVING SORTOUTPUT.
004401     PERFORM DISPLAY-THE-TIME.
004410 0001.
004500     STOP RUN.
004600 DISPLAY-THE-TIME SECTION.
004700     ACCEPT THE-TIME FROM TIME.
004800     MOVE THE-TIME TO DISP-THE-TIME.
004900     DISPLAY 'THE-TIME: ' DISP-THE-TIME.
 
it is not so difficult to write your own sort in COBOL, so why would you buy them?"

Not wanting to buy them. I'm writing my own file sort in an application in another language and I want a measuring stick to be sure that I'm doing it efficiently.
 
There are a lot of books about this and a lot of techniques. To compete with the professional, award winning programs is very difficult. If you have a file definition, I can send you an executable sorting program from ca-realia. What is the language you are writing in and what algorithm are you going to use? Important for the right approach can be to know if your file is most of the time much or little sorted or completely random.
 
I am aware that I need to put a lot of work into trying to get it to be effective. As for what I've got so far (still a long ways to go though), I'm very safe speed-wise compared to Fujitsu COBOL 3.0.

Right now the testbed I'm using is 20 million randomized 4-byte records (PIC S9(8) COMP-5 as Fujitsu COBOL flies) that is being sorted in ascending order. If you can, please send me the program. Since we can not post e-mails here according to the TOS, I will find another way to contact you.
 
OK your contact isn't listed here or anyplace else I'm aware of.
 
Glenn,

Be very careful about the judgements you make regarding performance based upon random data. Unless you are reasonably sure that your data will truly be random, you might get better results with algorithms that exploit the tendancy for real data not to be random.

Tom Morrison
 
my emailaddress you can find behind my profile...
 
Be very careful about the judgements you make regarding performance based upon random data. Unless you are reasonably sure that your data will truly be random, you might get better results with algorithms that exploit the tendancy for real data not to be random."

I am definitely mindful of that. There's always a purpose. Actually I tested a large number of known sorting algorithms, so I could probably tell you which one would ideally work in each purpose. The only one for COBOL programs that's ideal seems to be combsort, but that's not a great algorithm for languages that can handle index processing better than COBOL can.

"Glenn, tell us about your results..."

There's not much for results right now, because it's an apples to oranges comparison (my typed sort versus untyped sorts). But I did get a great idea of where some possible performance lines are so I can see how I will do with my sort when it is written to be an untyped one (my sort routine is kind of in beta stage).

As far as the program you provided me goes, it refused to sort my full testbed file (20m records, 80MB is evidently too much for it so it returned an error), but I pared the file down to 5m records and it worked. As far as time goes with the 5m records, my program has about 14 seconds to play with. Like I said though, a typed sort isn't good to compare against an untyped one, but at least it gives me a good idea of where my code is at performance-wise for now.
 
Glenn,
I have been using otsort for many years. It is 32 bit application runs from command prompt or can be called in many ways and is super fast. IF you wnat some info let me know.

Bob
 
You might doubt this but Java has some very interesting programming tools for sorting. Java has many different ways to describe files and to speed up sorting and file handling. Maybe a J2EE expert has some ideas. I dont know of many PC Utilities for sorting.

If you do not like my post feel free to point out your opinion or my errors.
 
Many of the COBOL compiler vendors provide SORT utilties. I have heard for requests (particularly of Micro Focus) for "DFS/ort" (or SyncSort) control card capabilities, but I don't know if any vendor has provided this.

I had an idea while I was working on something and thought of this quote. Actually, I'm finding this to be perhaps the toughest part of the project. The interpreter isn't the difficult part, but providing the mechanics to interact with the sort is. Basically, you have to answer the question "How do I handle data where nothing is known at compile time?" I have an answer, but like was said, it's a rough road to implement. I'm sure I'll get it done with enough time.
 
Am I correct that you (Glenn9999) work (at least some of the time) in a z/OS (IBM mainframe) COBOL environment? If so, you might be itnerested (related to this "nothing known at compile-time) issue, in a SHARE requirement that I wrote which asked for:

SSLNGC0413613 Dynamic file attribute options (ident-1 rather int-1 in FD)

If you are NOT working in an IBM mainframe environment, I know how to do this (today) with Micro Focus (but not with Fujitsu). Please feel free to contact me on or off-list for additional information.

Bill Klein
 
Actually I'm not doing the project in COBOL. But thanks for the offer, though.
 
Java may have something that will work. I have used it to sort files in school using Collections. That may require a program to be written.

DFSORT is a really complex utility. It would be difficult to duplicate everything it can do. There may be some way of coming up with .NET sort utility if the file was XML based. VB may have some sort of Sort options. A lot of people develop for .NET programming, so that gives you a better chance of finding what you want.

If you do not like my post feel free to point out your opinion or my errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top