printerAssociation

Use the converseVar.printerAssociation system variable to specify, at run time, the output destination when you print a form.For some file types, multiple print files can be open simultaneously.

You can use this variable in any of the following ways:
Characteristics of converseVar.printerAssociation are as follows:
Primitive type
CHAR
Data length
Varies by file type
Value saved across segmented converse?
Yes

converseVar.printerAssociation is initialized to the system resource name specified during generation or for debugging. If a program passes control to another program, the value of converseVar.printerAssociation is set to the default value for the receiving program.

To prevent interleaving of multiple print outputs, the print file is kept open until one of the following occurs: The close statement only closes the file related to the current value of converseVar.printerAssociation. If you change the value of converseVar.printerAssociation, the following occurs:

Compatibility

Table 1. Compatibility considerations for printerAssociation
Platform Issue
Java™ generation
For Java generation, you set converseVar.printerAssociation to a two-part string with an intervening colon:
  jobID:destination
jobID
A sequence of characters (without a colon) that uniquely identifies each print job. The characters are case sensitive (job01 is different from JOB01), and you can reuse jobID after a print job closes.
You can use different jobs to promote a different kind of output or a different ordering of output, depending on the flow of events in your code. Consider the following sequence of EGL statements, for example:
  converseVar.printerAssociation = "job1"; 
  print form1;
  converseVar.printerAssociation = "job2";
  print form2;
  converseVar.printerAssociation = "job1";
  print form3;
When the program ends, two print jobs are created:
  • form1 followed by form3
  • form2 alone
destination
The printer or file that receives the output.
The string destination is optional and is ignored if the print job is still open. The following statements apply if the string is absent:
  • You can omit the colon that precedes destination
  • In most cases, the program shows a print preview dialog from which the user can specify a printer or a file for output. The exception occurs if the curses library is used on UNIX; in that case, the print job goes to the default printer.
The following statements apply to the setting of destination when you are generating for Windows 2000/NT/XP:
  • To send output to the default printer, do as follows:
    • Specify a value that matches the fileName property in the resource associations part.
    • Change the Java runtime properties so that spool (rather than seqws) is the value of the related file type. For example, in the resource associations part, if the value of the fileName property is myFile and the value of systemName is printer, you must change the settings of Java runtime properties so that vgj.ra.myFile.fileType is set to spool rather than seqws. After your change, the properties are as follows:
        vgj.ra.myFile.systemName=printer
        vgj.ra.myFile.fileType=spool
  • To send output to a file, specify a value that matches the fileName property in the resource associations part, where seqws is the value of the related fileType property in the resource associations part. The systemName property is the resource associations part contains the name of the operating-system file that receives the output.
  • Do not specify printer as the value of destination . If you do, the print preview dialog is displayed to the user, but that behavior might change in later versions of EGL.
The following statements apply to the setting of destination when you are generating for UNIX:
  • To send output to the default printer (regardless of whether the curses library is in use), specify a value that matches the fileName property in the resource associations part, when spool is the value of the related fileType property in the resource associations part.
  • To send output to a file, specify a value that matches that of the fileName property in the resource associations part, when seqws is the value of the related fileType property in the resource associations part. The systemName property in the resource associations part contains the name of the operating system file that receives the output.
  • Do not specify the value printer as the value of destination. If you do (and if the curses library is not in use), the print preview dialog is displayed to the user, but that behavior might change in later versions of EGL.
CICS®
On CICS, the value of the printDestination build descriptor option determines the initial value of converseVar.printerAssociation or interacts with the vgLib.startTransaction() system function to determine the initial value:
  • If printDestination is set to PROGRAMCONTROLLED, the initial value of converseVar.printerAssociation is the value specified for the file name printer at generation time.
  • If the following conditions are all true, the initial value of converseVar.printerAssociation is the value specified for the prID parameter of that function:
    • The printDestination is set to TERMINALID.
    • The transaction starts by invocation of through a call to the vgLib.startTransaction() function.
    • The termID parameter of the vgLib.startTransaction() function is set to binary zeros.

If a CICS batch program was not started by the vgLib.startTransaction() function, converseVar.printerAssociation defaults to the CICS EIBTRMID, as appropriate to a program that is started at a terminal.

Only the following file types are supported:
SPOOL
The value of converseVar.printerAssociation is the output file name for a JES SPOOL file associated with a serial file. Multiple files can be open simultaneously.
The output file name has the following form and includes as many as 19 bytes:
  nodeid.userid.class

nodeid is either a 1 to 8-character system node ID or an asterisk (*). userid is either a 1 to 8-character system user ID or an asterisk (*). class is optional and is a 1-character spool class that defaults to A. If class is not specified, userid is also optional and defaults to the CICS user ID (the same value stored in sysVar.userID).

Refer to the CICS customization manual for more information.

TRANSIENT
The value is a 4-byte DCT name for a transient data queue associated with a serial file. The transient data queue name must be defined to CICS.

Multiple files can be open simultaneously.

IMS™ BMP
The support for converseVar.printerAssociation in an EGL-generated IMS BMP combines the support for that variable on the following platforms:
  • IMS/VS, where converseVar.printerAssociation is useful only for files of type SMSGQ.
  • z/OS® batch, where converseVar.printerAssociation is useful only for files of type SEQRS.
IMS/VS

Files of type SMSGQ are supported for output, but multiple files cannot be open simultaneously. The value (an 8-byte logical terminal name or transaction code) is defined to the IMS system and must be associated with a message queue that accepts single-segment messages. In the resource association part that is used at generation time, the file name must be associated with a modifiable alternate PCB or with a modifiable express alternate PCB.

The value in converseVar.printerAssociation is not folded to uppercase.

iSeries® COBOL

In relation to iSeries COBOL, set the converseVar.printerAssociation system variable to the value of the fileName property in the resource associations part that is used at generation time. The file type must be of type SEQ and not of type SPOOL.

Multiple print jobs are not supported for COBOL programs that are generated for iSeries, and when converseVar.printerAssociation is set, the EGL runtime closes the old file (to complete the previous output of data); uses the iSeries command OVRPRTF to override the file name; and opens the new file.

Prior to its use, the value in converseVar.printerAssociation is folded to uppercase; but the value in the system variable itself remains unchanged. The value of converseVar.printerAssociation tests TRUE when compared against a lowercase version if the system variable was initialized with a lowercase version.

The value set in converseVar.printerAssociation is propagated from the call level and changed to all the subordinate call levels. The value is not propagated, however if the program opened the file previously.

z/OS batch

You can set the converseVar.printerAssociation system variable only when referring to a file of type SEQRS. For a program generated as a z/OS batch program, the value of the variable is either a 54-byte data set name or an 8-byte DD name; and multiple files can be open simultaneously. The variable's initial value is the name of the file allocated to DD name EZEPRINT or (in the absence of that DD name) is the system resource name specified for file name printer at generation time.

When you set converseVar.printerAssociation, the file is connected by way of SVC99 dynamic allocation. The DISP option on the SVC99 is set to SHR, which means that the data set is rewritten each time it is opened for output.

Prior to its use, the value in converseVar.printerAssociation is folded to uppercase; but the value in the system variable itself remains unchanged. The value of converseVar.printerAssociation tests TRUE when compared against a lowercase version if the system variable was initialized with a lowercase version.


Feedback