In general applications, RPG print programs will generate a spool file with one or more pages. If you want to generate separate spool files from the single run of the program for each single page, or for a group of records, there is a way. By doing Closing and Opening of the Print file, or using FEOD Opcode you can do this. Every time Program Opens and Closes Printer file or executes FEOD command it closes the current spool file and opens the new spool file for the same printer file.
This technique can be use in a situation where the spool file is copied to a database file and then the database file is again spilt into more specific files. To avoid the hassle of splitting into specific files you can code the same logic into the main print program and split the spool file instead. And what you get is filtered data in separate spool files to be copied to different database files.
There can be many more uses for this technique.
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts including news, tips, and advice to help you do your job more efficiently and effectively. Stay informed on the hottest topics and biggest challenges faced by IT professionals working with iSeries products and services.
This was first published in April 2001