View previous topic :: View next topic |
Author |
Message |
waves Beginner
Joined: 09 Nov 2006 Posts: 35 Topics: 12
|
Posted: Thu Oct 11, 2007 10:43 am Post subject: Sort in cobol |
|
|
I need to do the sort in COBOL program.
i have an input file which has the SSN number, First name, Last name, Timestamp etc. as some of its columns.
i need to sort the input file so that i get the latest record from the input file based on the Timestamp.
In this case, the first sort was done on the SSN number,first name and last name in Ascending order and then the Timestamp in the descending order.
the second sort was done on the SSN Number, First name and Last name, so that all the duplicates will be removed giving SUM FIELDS = NONE.
the final out put file will contain the Latest record. These things i have done in thru JCL.
the same has to be done in the COBOL Program. please i need help how to do the same in COBOL.
please correct me if i'm wrong.
We are using SYNCSORT Product.
Thanks in Advance. |
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Thu Oct 11, 2007 11:08 am Post subject: |
|
|
It can be done with one pass/sort, either thru JCL or COBOL..A single pass summing on the first three fields and keeping the first (descending) of the last (ascending) timestamp.
Does the data really want to keep different spellings of the same person? Only one SSN per person.....
The SORT statement is fairly straight forward, have you a particular question about it? |
|
Back to top |
|
 |
waves Beginner
Joined: 09 Nov 2006 Posts: 35 Topics: 12
|
Posted: Fri Oct 12, 2007 12:34 am Post subject: |
|
|
thanks a lot for the quick reply.
can u please give an example for the sort in cobol. |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
|
Back to top |
|
 |
|
|