On Fri, 23 Aug 2019 at 14:25, John Imholte <[email protected]> wrote:
> 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. > Yes, there's a lot on SPEC. Especially when you dive into the so-called 407 support. Just yesterday I had to number the records in groups of 3 with the same number, so you do ... | spec print (number()-1)%3 1.10 r 1-* nw | ... There's "pipe ahelp spectut" to start, and "ahelp specref" as well. But reading the book as PDF is probably a better option. Note that the PDF is full of hyperlinks, even though they are not decorated as such (it would be too distracting). > 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? > Yep, when it's a disk file you know the number of records already. You can use REXX substitution to specify the width of the field. To do it with data straight from the pipe, you'd use BUFFER to hold it while you're deciding on the width. I recently did a pipeline to arrange the cells in a (sparse) table such that the width of each column is just enough to hold the longest cell in it. This feels like a simple variation of that, let me have a look... Sir Rob the Plumber
