View previous topic :: View next topic
|
Author |
Message |
SRUTHI DRAVIDAMANI
New User
Joined: 31 Jan 2018 Posts: 7 Location: INDIA
|
|
|
|
How to add a new field sequence number? Requirement is:
The records which are identical in Journal ID, Account-ID, Date and Amount fields then the first record will have sequence number as 001 and the second record will have sequence number as 002 and so on. The records which are not duplicates will have sequence number 001. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
What have you tried so far. This is not a 'write your code for you' forum but a 'help you when your code fails' forum. We do not write specifications either. And if you cannot come up with even a basic program like this then you should be in the sister site "Beginners Forum" @ Use [URL] BBCode for External Links and not the Experts Forum. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
As with your previous posted topic, this is possibly something that your sort software - either SYNCSORT or DF/SORT - could very easily accomplish. |
|
Back to top |
|
|
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
You have a conflict in your requirements,
the first duplicate record will have the sequence number of 001 and The records which are not duplicates will have sequence number 001. |
|
Back to top |
|
|
SRUTHI DRAVIDAMANI
New User
Joined: 31 Jan 2018 Posts: 7 Location: INDIA
|
|
|
|
First duplicate record will have sequence 001 and the second record will have 002 and records which are not duplicates will have seq num 001 |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Have you considered my suggestion of using your sort product to achieve this very easily.
And looking at your original post, there is so little information given.
We usually like the following information which is rather key to being able to help:-
Dataset RECFM=
Dataset LRECL=
Estimate #records
Position of key fields
Format of key fields
Length of key fields
Also, regarding the post of Nic Clouston above -
Please tell us what YOU have tried yourself and the results from the failed processes. |
|
Back to top |
|
|
SRUTHI DRAVIDAMANI
New User
Joined: 31 Jan 2018 Posts: 7 Location: INDIA
|
|
|
|
No i cannot use sort. I have ten files and each file has to check duplicates and add sequence number to it. So i have to do this in COBOL only. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
SRUTHI DRAVIDAMANI wrote: |
No i cannot use sort. I have ten files and each file has to check duplicates and add sequence number to it. So i have to do this in COBOL only. |
Is this the same 'requirement' in your other topic?. If yes one of the duplicate topics will be deleted. I think you need to start over and try explaining in detail what you are really trying to achieve , along with some sample input and expected output records. Plus turning a blind eye to the questions asked here, is not going to help you.
From the little information you have shared so far, it cannot be determined whether your sort product can/cannot be used to achieve what you are trying to do. Having '10 files' does not seem to be a reason not to use your sort product. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
SRUTHI DRAVIDAMANI wrote: |
No i cannot use sort. I have ten files and each file has to check duplicates and add sequence number to it. So i have to do this in COBOL only. |
The total number of files to process is not related in any manner with the tool, or method used to process them.
It has to be a sort of nonsense:
1 file - must use SORT facility
10 files - must use COBOL(???) code |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Rohit Umarjikar wrote: |
waste of time.. |
Fixed it for you |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
You mean locked? I don't see it |
|
Back to top |
|
|
|