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 

Duplicate record count

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


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Tue Apr 24, 2007 1:33 pm    Post subject: Duplicate record count Reply with quote

I need to insert the count against each of the duplicate records. I searched the forum for "Count" but couldn't find any examples which satisfy my criteria.

Here's the I/p file

xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxx
yyyyyyyyyyyyyyyyyyyyyyy
yyyyyyyyyyyyyyyyyyyyyyy
uuuuuuuuuuuuuuuuuuuuu
uuuuuuuuuuuuuuuuuuuuu
yyyyyyyyyyyyyyyyyyyyyyy
xxxxxxxxxxxxxxxxxxxxx

O/p file

xxxxxxxxxxxxxxxxxxxxx 1
xxxxxxxxxxxxxxxxxxxxx 2
xxxxxxxxxxxxxxxxxxxxx 3
yyyyyyyyyyyyyyyyyyyyyyy 1
yyyyyyyyyyyyyyyyyyyyyyy 2
uuuuuuuuuuuuuuuuuuuuu 1
uuuuuuuuuuuuuuuuuuuuu 2
yyyyyyyyyyyyyyyyyyyyyyy 3
xxxxxxxxxxxxxxxxxxxxx 4

-Mt
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 24, 2007 1:53 pm    Post subject: Reply with quote

Martin,

May be you haven't searched correctly. Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=2174&highlight=total+splice

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Apr 24, 2007 3:07 pm    Post subject: Reply with quote

Martin,

I think Kolusu assumed you wanted the count for each key inserted for each record with that key and that's the job he pointed you to.

But it appears you want a sequence number for each key inserted for each record for that key. Here's a DFSORT/ICETOOL job that will give you that:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN   DD    *
SORT FROM(IN) TO(T1) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(31:SEQNUM,5,ZD)
  SORT FIELDS=(1,23,CH,A)
  OUTREC OVERLAY=(25:SEQNUM,5,FS,RESTART=(1,23))
/*
//CTL2CNTL DD *
  SORT FIELDS=(31,5,ZD,A)
  OUTREC BUILD=(1,30)
/*


OUT would have:

Code:

xxxxxxxxxxxxxxxxxxxxx       1
xxxxxxxxxxxxxxxxxxxxx       2
xxxxxxxxxxxxxxxxxxxxx       3
yyyyyyyyyyyyyyyyyyyyyyy     1
yyyyyyyyyyyyyyyyyyyyyyy     2
uuuuuuuuuuuuuuuuuuuuu       1
uuuuuuuuuuuuuuuuuuuuu       2
yyyyyyyyyyyyyyyyyyyyyyy     3
xxxxxxxxxxxxxxxxxxxxx       4

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 24, 2007 4:51 pm    Post subject: Reply with quote

Frank,

Ooopsie. just read the entire question once again. sorry

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Mon Apr 30, 2007 1:22 pm    Post subject: Reply with quote

Frank Yaeger,

Thanks a lot for the solution .

I need to prefix zeroes before the count. Could you please tell me what changes need to be made here.

O/P

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 0001
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Apr 30, 2007 1:33 pm    Post subject: Reply with quote

Change the CTL1CNTL OUTREC statement to:

Code:

   OUTREC OVERLAY=(25:SEQNUM,4,ZD,RESTART=(1,23))

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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