Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
If you want a count of groups, and groups start with a B, identify the group in the usual way (BEGIN looks for B) and PUSH ID. ID is a sequence number at group level. First group is one, second is two, third is... you get the picture already.
Then you have something for your IFTRAIL (or a simple IFTHEN) to identify the trailer record, put in the extended ID and it should be about there. Cut the record back down to size, dropping off the now unwanted extra bytes.
If you want a count of groups, and groups start with a B, identify the group in the usual way (BEGIN looks for B) and PUSH ID. ID is a sequence number at group level. First group is one, second is two, third is... you get the picture already.
Then you have something for your IFTRAIL (or a simple IFTHEN) to identify the trailer record, put in the extended ID and it should be about there. Cut the record back down to size, dropping off the now unwanted extra bytes.
Hi Bill,
Yes, I know the WHEN=GROUP and PUSH function, how to put the extended ID into the IFTRAIL to only display the count of groups?
I tried with the below code, it returns the count 12 which is all records of BCDE.
The ID is only valid on the PUSH. After the PUSH, the ID is in the position it has been PUSHed to.
Since the OUTFIL is not used for anything else, I've used IFOUTLEN to set the length of the record., so the BUILD is not needed to do that. Not tested, but should be close.
The ID is only valid on the PUSH. After the PUSH, the ID is in the position it has been PUSHed to.
Since the OUTFIL is not used for anything else, I've used IFOUTLEN to set the length of the record., so the BUILD is not needed to do that. Not tested, but should be close.
Hi Bill,
Here's the code works, within group only need to specify the B record otherwise no ID will be pushed in the trailer line. And you have a typo in the overlay statement, it's (13:513,8) instead of (13:513:8)