Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
add sequence number for duplicate records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: add sequence number for duplicate records
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: 2033
Location: UK

PostPosted: Thu Feb 22, 2018 6:28 pm    Post subject:
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" @ www.ibmmainframeforum.com and not the Experts Forum.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8697
Location: Back in jolly old England

PostPosted: Thu Feb 22, 2018 6:38 pm    Post subject:
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: 114
Location: Puerto Rico

PostPosted: Thu Feb 22, 2018 8:04 pm    Post subject:
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    Post subject: Hi Jemo
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: 8697
Location: Back in jolly old England

PostPosted: Thu Feb 22, 2018 8:22 pm    Post subject:
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    Post subject: Hi Nic
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: 2369
Location: @my desk

PostPosted: Thu Feb 22, 2018 8:30 pm    Post subject: Re: Hi Nic
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

Active User


Joined: 29 Apr 2008
Posts: 323
Location: Maryland

PostPosted: Thu Feb 22, 2018 10:48 pm    Post subject: Re: Hi Nic
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

Senior Member


Joined: 21 Sep 2010
Posts: 1939
Location: NY,USA

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

http://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: 8697
Location: Back in jolly old England

PostPosted: Fri Feb 23, 2018 1:41 pm    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1939
Location: NY,USA

PostPosted: Sat Feb 24, 2018 3:31 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need Help to Create 4 Output Records ... satish.ms10 DFSORT/ICETOOL 4 Thu Jul 19, 2018 1:55 am
No new posts Remove duplicate record with condition rajiv rengasamy DFSORT/ICETOOL 4 Wed Jul 11, 2018 3:55 pm
No new posts Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us