Page 3 of 3

Re: How to Implement Bubble sort in Cobol ??

PostPosted: Mon Dec 06, 2010 7:26 pm
by Robert Sample
I am still struggling to get output . Pls tell me what to do ??? Till average calculation , I have completed ! Next Rank Calculation is little bit tuff for me !!
Why? Once you've got the averages sorted in descending order, the first one gets rank 1. If the second average is the same as the first, it also gets rank 1 -- otherwise it gets rank 2.

Re: How to Implement Bubble sort in Cobol ??

PostPosted: Fri Dec 10, 2010 1:08 am
by Balr14
Many companies do this with tableBASE. Just load the data into a tableBASE table and define an alternate index. It's very fast.

Re: How to Implement Bubble sort in Cobol ??

PostPosted: Fri Dec 10, 2010 1:31 am
by enrico-sorichetti
most probably the TS does not have tableBASE
since this is a A Help & Support Forum for Mainframe Beginners and Students
maybe is just trying to carry on some assignment

Re: How to Implement Bubble sort in Cobol ??

PostPosted: Fri Dec 10, 2010 1:55 am
by dick scherrer
Hello,

Even if tablebase is on the system, the requirement is to do this using cobol. . .

Re: How to Implement Bubble sort in Cobol ??

PostPosted: Wed Dec 22, 2010 3:30 pm
by GuyC
you don't need average for a bubblesort.
All you need is
a loop : perform until
a compare : if A > B
and a SWAP, which in COBOL can only be done by using a additional WS field/record: move A to X . move B to A . move X to B.

Re: How to Implement Bubble sort in Cobol ??

PostPosted: Thu Dec 23, 2010 1:50 am
by dick scherrer
Hi Guy,

If i understand, the goal is to sort the averages into ranks (rather than sorting "detail").