Thanks Rob, that is exactly what I was looking for. The 'SPEC' stage must be the most powerful. I should open the manual and not relay on the CMS HELP file.
As for as the number size I might just do that with the EXEC and use 'LISTFILE' for the file size and limit the number size that way. But if it would not be to much to ask how would one determine the number of records prior to the 'SPEC' stage? On Fri, Aug 23, 2019 at 2:12 AM Rob van der Heij <[email protected]> wrote: > On Fri, 23 Aug 2019 at 02:20, John Imholte <[email protected]> wrote: > > > I know that I have seen this on the list but don't remember and can't > find > > it, so I finally give up and come the the list. > > > > I have a file that I would like to add sequence to the left of the > record. > > It would also be nice if I might edit the sequence number to a length of > > the record count +1 zero suppressed. > > > The classic way to add record numbers is like this (and there are options > to change the start and increment) > > .. | spec number 1.10 r 1-* nw | .. > > That's without leading 0's. If you'd want those, you can use PAD 0 to have > that. And you can use a different width of the field. > > Do you mean you want to limit the width of the numbers to what you need for > the last one? That means you'd have to buffer the entire stream to find out > how many you have, and use that to determine the width. Or you can use that > information to remove the first few bytes once you know it's too much. > > Sir Rob the Plumber > -- Sincerely, John Imholte
