Using converseVar.printerAssociation

You can set the value of the converseVar.printerAssociation system variable to change the print file destination (transient data queue or spool file name) at run time.

To change the print file destination, the program sets the converseVar.printerAssociation system variable to the new system resource name for the print file before the print statement is run. The new resource must have the same file type as the one specified for printer when the program was generated.

Multiple print files can be open at the same time. A print statement writes to the resource named in converseVar.printerAssociation at the time the statement is run. A close statement for a print form closes only the resource named in converseVar.printerAssociation. Any files not explicitly closed are closed at the end of the transaction or segment, or commit point for spool files.

The default value for converseVar.printerAssociation is the system resource name specified for the printer file at generation. If you set the printDestination build descriptor option to TERMINALID and the program was started with a vgLib.startTransaction() that had the termID parameter set to binary zeros and that specified a prID parameter, then converseVar.printerAssociation is initialized to the value in the prID.

If the program was started by a non-EGL program that specified the RTERMID on the START command, then converseVar.printerAssociation is initialized to the value specified for RTERMID.


Feedback