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 

Writing unique numbers for duplicate records thru syncsort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Tue Apr 07, 2015 9:34 pm    Post subject: Writing unique numbers for duplicate records thru syncsort Reply with quote

Hi,

Could you please help me in the following query:

I've a file with 5 fields and they may contain duplicate records. I want to write unique numbers to those duplicate records thru syncsort.
for example:
Code:

NAME   AGE   M/F   AMOUNT     ADDR
SIV     30     M     1000      XYZ
SIV     30     M     1000      XYZ
SAI     31     M     2000      ABC
SAI     31     M     2000      ABC

Now i want to have unique numbers as below:

Code:

NAME   AGE   M/F   AMOUNT     ADDR   UNIQUE NUMBER
SIV     30     M     1000      XYZ      1
SIV     30     M     1000      XYZ      2
SAI     31     M     2000      ABC      1
SAI     31     M     2000      ABC      2

Could you please resond to this query at the earliest as this is an urgent requirement.



Thank you,


Regards,
Kirank
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Wed Apr 08, 2015 1:34 am    Post subject: Reply with quote

You'll need to look at the document of WHEN=GROUP, with PUSH and SEQ, which is a sequence number within the group.

Code:
  INREC IFTHEN=(WHEN=GROUP,
                 KEYBEGIN=(startofkey,lengthofkey),
                 PUSH=(positionyouwantit:SEQ=1))


Something like that, as an outline.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Wed Apr 08, 2015 11:08 am    Post subject: Re: Writing unique numbers for duplicate records thru syncso Reply with quote

kirank wrote:

Could you please resond to this query at the earliest as this is an urgent requirement.


Kirank,

Since you already got the answer, you need to consider the following in future.

You need to remember that people help on voluntary basis. So please be respectful to their timings instead of demanding the solution as it an "Urgent requirement " . The usage of "Urgent/Immediately" would actually put off many people who are willing to help.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
t-bonham@scc.net
Supermod


Joined: 18 Oct 2012
Posts: 30
Topics: 0
Location: Minneapolis, MN

PostPosted: Wed Apr 08, 2015 12:18 pm    Post subject: Reply with quote

Do you really need the unique number restarting from 1 for each group?

If not, you could just insert a sequence number on each record, which will make them unique. And that will run faster, since Sort won't have to keep track of the groups.
Back to top
View user's profile Send private message Send e-mail AIM Address
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Fri Apr 24, 2015 10:20 pm    Post subject: Reply with quote

Thank you so much for the solution. Kolusu I will keep in mind your suggestion Smile
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 -> Utilities 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