If you need help with any of the techniques described below, feel free to contact our support team.
My spooled file contains multiple documents (invoices, statements etc.) that need to be sent to different people (customers, departments etc.). How can I split/burst the spooled file so I can do that?
Easy. CoolSpools has some great options for splitting spooled files. Unlike most other products, you don’t need to modify your spooled file to do this either.
The relevant command parameters are:
The SPLIT parameter tells CoolSpools to create several stream files from a single spooled file, splitting the spooled file based on criteria that you specify on the SPLITPAGE, SPLITPOS and/or SPLITKEY parameters.
This option can be useful if your program produces a single spooled file which has traditionally been split up into separate pages or groups of pages prior to distribution on paper.
There are a number of different ways in which you can tell CoolSpools when to create a new file. These give an enormous amount of flexibility and we have not yet found an application where one of these options is not able to do the job. Here are just the most commonly found scenarios:
CVTSPLPDF ... SPLIT(*PAGE) SPLITPAGE(3)
CVTSPLPDF ... SPLIT(*POS) SPLITPOS((3 50 13 *ROWCOL *EQ 'I N V O I C E'))
CVTSPLPDF ... SPLIT(*POS) SPLITPOS((6 20 7 *ROWCOL *NE *PRV))
where *PRV is a special value denoting “the value at that position on the previous page”
CVTSPLPDF ... SPLIT(*POS *AFTER)
so CoolSpools knows to create a new file after the page on which the text is found, not before it as is the default.
CVTSPLPDF ... SPLIT(*KEY *BEFORE) SPLITKEY('STRING FOUND ON FIRST PAGE ONLY')
CVTSPLPDF ... SPLIT(*KEY *AFTER) SPLITKEY('STRING FOUND ON LAST PAGE ONLY')
When creating an Excel file, you can also now tell CoolSpools to split a spooled file and create a new worksheet in the output file rather than a new file.
If you specify several levels of splitting, you can also split to new files and new sheets at the same time.
For example, imagine you have a sales report that contains sales figures organized by region and then by city with region. You might want to create one spreadsheet per region, but have separate worksheets for each city within the region. This might be achieved by telling CoolSpools to split every time the region name changes, and create a new workbook, and also to split every time the city name changes, but create a new worksheet when that happens.
For example, if the region name is on line 3 at position 5 for 10 characters and the city name on line 4 at position 5 for 20 characters:
SPLITPOS((3 5 10 *ROWCOL *NE *PRV *WORKBOOK) (4 5 20 *ROWCOL *NE *PRV *WORKSHEET))