View previous topic :: View next topic |
Author |
Message |
jbrasher Beginner
Joined: 26 Apr 2007 Posts: 5 Topics: 2
|
Posted: Tue Feb 12, 2008 4:26 pm Post subject: Add ing a record count to records in a set |
|
|
I've got the following file:
123 123
123 456
123 789
123 012
124 876
124 943
124 124
124 086
I'd like to add the count of 'subsidary' records to the 'prime record' and all 'subsidiary' records.
I've gotten the count into the 'prime' record:
123 123 0003
123 456 0000
123 789 0000
123 012 0000
124 876 0000
124 943 0000
124 124 0003
124 086 0000
by using some examples of splice but I'm stuck with replecating the count
to each set of records, i.e.,
123 123 0003
123 456 0003
123 789 0003
123 012 0003
124 876 0000
124 943 0003
124 124 0003
124 086 0003
Any help or pointers would be appreciated
Thanks, _________________ John |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
|
Posted: Tue Feb 12, 2008 4:58 pm Post subject: |
|
|
jbrasher,
Please SEARCH before posting . Check this link
http://www.mvsforums.com/helpboards/viewtopic.php?p=10320#10320
The only change you would need is use COUNT-1 instead of count.
Code: |
OPTION EQUALS
SORT FIELDS=(01,03,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(01,03,
TRAILER3=(01,03,7X,COUNT-1=(M11,LENGTH=4)))
|
Hope this helps.. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
jbrasher Beginner
Joined: 26 Apr 2007 Posts: 5 Topics: 2
|
Posted: Tue Feb 12, 2008 7:33 pm Post subject: |
|
|
Kolusu,
Thanks for the help.
I found that example and that's what I used to get the counts that I have
but what I'm looking to do is have the count of the 'secondary' records IN
each of the secondary records also.
The original file is keep the same except that there is a count of the number of secondary records in each set in each record.
Does that make sense? _________________ John |
|
Back to top |
|
|
jbrasher Beginner
Joined: 26 Apr 2007 Posts: 5 Topics: 2
|
Posted: Wed Feb 13, 2008 9:42 am Post subject: |
|
|
Kolusu,
Sigh, some days you know you should have been a plumber ...
Some other processing I had to do to this file got me looking at it the wrong way.
I had the answer all along.
Thank you for your help. _________________ John |
|
Back to top |
|
|
|
|