I’m a novice when it comes to sync sort. I tried searching for an answer to my question, but it has been to no avail. I’m trying to group/add the same sequence number based on an account number. I got that part working, but I also need to limit the number per group to 7. I need the sequence number to increment at the account number change and when the number of records equals 7. Thanks in advance!
Here is what I have so far.
Input file…
000000000000001
000000000000002
000000000000003
000000000000004
000000000000004
000000000000004
000000000000004
000000000000004
000000000000004
000000000000004
000000000000004
000000000000004
000000000000004
000000000000005
000000000000006
000000000000007
000000000000008
SORT FIELDS=(132,15,CH,A)
OUTREC IFTHEN=(WHEN=INIT,RECORDS=7,OVERLAY=(3301:SEQNUM,8,ZD,
RESTART=(132,15))),
IFTHEN=(WHEN=GROUP,BEGIN=(3301,8,ZD,EQ,1),PUSH=(3290:ID=8))
OUTFIL BUILD=(1,3300)
Current output:
00000001
00000002
00000003
00000004
00000004
00000004
00000004
00000004
00000004
00000004
00000004
00000004
00000004
00000005
00000006
00000007
00000008
Desired output:
00000001
00000002
00000003
00000004
00000004
00000004
00000004
00000004
00000004
00000005
00000005
00000005
00000005
00000006
00000007
00000008
00000009