From: Barry Jones
I have an application that sends batches of inventory transaction data to a batch processor program throughout the day, but I want the audit report to print at night, and I want all the batches in one spool entry instead of in separate ones that waste paper.
The catch is that these are S36EE programs. I've read in the knowledge base that one can write a dummy RPG/400 program that simply opens a print file under user control, then returns without setting on LR, leaving the file open.
My idea is to create a copy of the QSYSPRT printer file, which is basically a "formatless" file, open that file using the dummy program, and then override my RPG II print file to the dummy one and have it continuously spool there.
Then, at 11:30 p.m. or so, I could close the print file and start printing.
Does anyone have any ideas why this wouldn't work?
From: Pete Hall
To: Barry Jones
S36EE jobs use a printer file in library #LIBRARY with the same name as the mapped S36EE printer device (e.g., P1, P2). Your override should be to this file, and you must specify SHARE(*YES).
Be aware that overrides are in effect only for the job in which they are issued. If you are trying to combine output from several jobs, consider this alternate technique:
1. Create a dummy printer file in #LIBRARY based on one already there (call it printer "PX," for instance).
2. Use the Create Output Queue (CRT-OUTQ) command to create an output queue with the same name.
3. Change the printer file to send its output to that output queue with the Change Printer File (CHGPRTF) command.
4. Send your printer output to that file with a //PRINTER OCL command.
5. To print, attach that output queue to a real printer using the Change Writer (CHGWTR) command.
If you need to combine all of the printed output into one spool file entry, copy all of these spooled files off of the dummy output queue with the Copy Spooled Files (CPYSPLF) command, and then copy them back to an active output queue with the Copy File (CPYF) command.