IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

add sequence number for duplicate records


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SRUTHI DRAVIDAMANI

New User


Joined: 31 Jan 2018
Posts: 7
Location: INDIA

PostPosted: Thu Feb 22, 2018 5:37 pm
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Feb 22, 2018 6:28 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Feb 22, 2018 6:38 pm
Reply with quote

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

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Thu Feb 22, 2018 8:04 pm
Reply with quote

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

New User


Joined: 31 Jan 2018
Posts: 7
Location: INDIA

PostPosted: Thu Feb 22, 2018 8:07 pm
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Feb 22, 2018 8:22 pm
Reply with quote

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

New User


Joined: 31 Jan 2018
Posts: 7
Location: INDIA

PostPosted: Thu Feb 22, 2018 8:25 pm
Reply with quote

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

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Feb 22, 2018 8:30 pm
Reply with quote

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

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Thu Feb 22, 2018 10:48 pm
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Thu Feb 22, 2018 11:50 pm
Reply with quote

ibmmainframes.com/viewtopic.php?t=66448&highlight=
waste of time.. duplicate and should locked.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Feb 23, 2018 1:41 pm
Reply with quote

Rohit Umarjikar wrote:
waste of time..


Fixed it for you icon_lol.gif icon_lol.gif icon_lol.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Sat Feb 24, 2018 3:31 am
Reply with quote

Quote:
Fixed it for you

You mean locked? I don't see it icon_eek.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top