IBMi (AS400) fans only : How to write to the same printerfile from more programs
#IBMiSample
A simple way is to leave the file open by ending programs with RETURN instead of SETON LR.
Example:
Program A calls Program B.
Program B opens a printerfile and write some pages in the spool file.
Program B closes with RETURN. The printer file is already open.
Program A calls Program B again.
Program B opens a printerfile (it is already open) and write some other pages on the same spool file.
Program B closes with RETURN. The printer file is already open.
Program A calls Program B again.
Program B opens a printerfile (it is already open) and write some other pages on the same spool file.
Program B closes with RETURN. The printer file is already open.
... and so on.
At the end, run RCLACTGRP ACTGRP(QILE). This command will end the QILE activation group, it means the spool file will also be closed.
I appreciate all the comments made on this blog.
Comments
Post a Comment