How to send a report to an AS/400 and "HOLD" it
There are two possibilities when a report or procedure is sent to an AS/400: 1. Via screen. In this case the attribute HOLD = Yes, and it is eliminated from the line once it is executed. 2.Directly to the printer (attribute HOLD in NO)
There are two possibilities when a report or procedure is sent to an AS/400:
- Via screen. In this case the attribute HOLD = Yes, and it is eliminated from the line once it is executed.
- Directly to the printer (attribute HOLD in NO)
In some cases you may want to leave it holding. This can not be solved defining a new PRINTER FILE or modifying the existing one, as the attribute HOLD is overwritten by the values in the generated program.
The OVRPRTF heritage (as well as OVRDBF) implies that the first OVR of the chain has preference. So, if an OVRTPRTF is carried out with an X value in an option and then an OVRPRTF with the value Z, the X will "win". This is valid in the program chain, that is, once the program that created the OVRPRTF is executed, that OVR disappears.
The solution then is creating a CL program to carry out an OVRPRT of the PRINTER FILE with the value HOLD = YES (only that attribute). A call to the report or procedure should be made later in that same CL program.
Example:
OVRPRTF FILE(QPRINT) HOLD(*YES)
<Call to Report or Procedure>