MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sort in cobol

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
waves
Beginner


Joined: 09 Nov 2006
Posts: 35
Topics: 12

PostPosted: Thu Oct 11, 2007 10:43 am    Post subject: Sort in cobol Reply with quote

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
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Thu Oct 11, 2007 11:08 am    Post subject: Reply with quote

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
View user's profile Send private message
waves
Beginner


Joined: 09 Nov 2006
Posts: 35
Topics: 12

PostPosted: Fri Oct 12, 2007 12:34 am    Post subject: Reply with quote

thanks a lot for the quick reply.

can u please give an example for the sort in cobol.
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Oct 12, 2007 12:54 am    Post subject: Reply with quote

waves,

Did u look into the example in the link I provided in your previous thread discussing the same problem?

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG10/1.12.10.2?DT=20020923143836
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group