View previous topic :: View next topic
|
Author |
Message |
venugopal404
New User
Joined: 14 Dec 2010 Posts: 13 Location: hyderabad
|
|
|
|
please help me out
input:
12345abc12/02/1988
45865fgs02/15/1963
87468sdf01/12/2001
12345abc12/02/1988
87468sdf01/12/2001
required output by using cobol:
12345abc12/02/1988
45865fgs02/15/1963
87468sdf01/12/2001
FB/80 |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Is using cobol part of the requirement, and why?
If you sort the dataset with NODUPKEY keyword (do not have the sort documentation online) duplicate records on the key will be deleted. |
|
Back to top |
|
|
venugopal404
New User
Joined: 14 Dec 2010 Posts: 13 Location: hyderabad
|
|
|
|
Yes,
using cobol is part of the requirement..using JCL, i know how to sort the file.
i just want to know, how can we do it using cobol.. |
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
You have to sort the file in key sequence anyway, read a record, store the key value, compare to that of the previous record, if different write to output, else do nothing, start over with the read.
Is that so difficult? |
|
Back to top |
|
|
venugopal404
New User
Joined: 14 Dec 2010 Posts: 13 Location: hyderabad
|
|
|
|
thank you Kjeld |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
Back to top |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
Kjeld wrote: |
You have to sort the file in key sequence anyway, read a record, store the key value, compare to that of the previous record, if different write to output, else do nothing, start over with the read.
Is that so difficult? |
There is a flaw in my logic above, so I have to correct myself: The compare with the previous record key has to be done before you store the value of the current record in it. |
|
Back to top |
|
|
|