New support added with QO77734 for files created with the Virtual Printer Interface and printed on TCP/IP printers by coding VPSOPT=15.

Document ID : KB000053623
Last Modified Date : 14/02/2018
Show Technical Document Details

Description

VPSOPT=15 specialized node parameter was added with QO77734 to read input print records for a $$FORMS= as the first print record. The FORM is used to pass print formatting commands to the TCP/IP printer and can be read from a PCLLIB or PJLLIB resource library.

Solution

This new support is included in the base r11.5, SP0, 0808. It is also included in r11.0, SP2, 0607. For previous genlevels of r11.0 you can apply APAR QO77734 to add this new support.

The new support provides specialized code that is invoked only if the printer DEFNODE/NODE defintion contains a VPSOPT=15 specification. This code can be used as an example of how to set file attributes that affect print formatting based on information contained in the data.

If VPSOPT=15 is specified, at print time, print exit ESFU009 will examine the first print record for the keyword $$FORMS= beginning some where between position 1 and position 12. If $$FORMS= is found, the 8 character form name following the $$FORMS= will be used as the FORM name to select the desired member from the PCLLIB or PJLLIB resource library. In addition, the record containing the $$FORMS= keyword will be deleted from the print file.

Example 1:

  1. This node using print driver PCL5 with print driver option G, virtual printer interface and the new node parameter will read the PCLLIB looking for a member called FORMSTD1 :

    NODE PRT1,TCPIP,GROUP=1,
    VPS=VPRT1,VPSFILE=BRACKET,VPSOPT=6, VPSOPT=15 ,
    TCPHOST=111.22.3.44, TCPDRIV=PCL5G

  2. Example print file with $$FORMS=STD1 in the first print record:

    ****** ***************************** Top of Data ****************************
    000001 $$FORMS=STD1
    000002 This report will print in Portrait Orientation, with a Pitch of 12.00
    000003 and 6 lines per inch based on PCLLIB resource member called FORMSTD1.
    ****** **************************** Bottom of Data **************************

  3. Example how to code a FORMSTD1 in a PCLLIB resource library.

    If not already created and in use, you will need a PCLLIB PDS library with file attributes RECFM=VB,LRECL=259,BLKSIZE=2594. Add this as a new DD to your CA Spool proc and recycle the task.

    //PCLLIB DD DSN=CAI.ESF.PCLLIB,DISP=SHR

    Note that you have to use HEX ON command in ISPF Edit and each PCL command requires an escape character (<esc> = x'27') as well as being coded in EBCDIC. These PCL commands are translated automatically from EBCDIC to ASCII.

    Additions, modifications or deletes of PCLLIB members can be done on the fly. No REINIT and no RECYCLE is required. This library is only read when a file is selected to print on an IP printer that has a print driver option to allow read of the resource library. (See Page 3-137 in the r11.5 Customization Guide, for a list of print drivers and options.)

    See www.hp.com for list of basic PCL commands.
      EDIT       CAI.ESF.PCLLIB( FORMSTD1 )         - 01.03        Columns 00001 00072   Command ===>                                                  Scroll ===> CSR   ****** ***************************** Top of Data *****************************   000001 &l1O                                                                           259FD444444444444444444444444444444444444444444444444444444444444444444          70316000000000000000000000000000000000000000000000000000000000000000000   ------------------------------------------------------------------------------   000002  (s12.00H          24AFF4FFC44444444444444444444444444444444444444444444444444444444444444 
    7D212B00800000000000000000000000000000000000000000000000000000000000000 ------------------------------------------------------------------------------ 000003 &l6D 259FC444444444444444444444444444444444444444444444444444444444444444444
    70364000000000000000000000000000000000000000000000000000000000000000000 ------------------------------------------------------------------------------ ****** **************************** Bottom of Data ***************************
  4. Once you have the above completed you can run a print transaction from your online application that will write to the virtual printer called VPRT1 as specified in the NODE for PRT1 to create a new print file.

Example 2:

  1. This node using print driver PJL4 with print driver option G, virtual printer interface and the new node parameter will read the PJLLIB looking for a member called FORMSTD2 :

    NODE PRT1,TCPIP,GROUP=1,
    VPS=VPRT1,VPSFILE=BRACKET,VPSOPT=6, VPSOPT=15 ,
    TCPHOST=111.22.3.44, TCPDRIV=PJL4G

  2. Example print file with $$FORMS=STD2 in the first print record:

    ****** ***************************** Top of Data ****************************
    000001 $$FORMS=STD2
    000002 This report will print in Landscape Orientation, with a Pitch of 15.00
    000003 and 48 lines per page based on PJLLIB resource member called FORMSTD2.
    ****** **************************** Bottom of Data **************************

  3. Example how to code a FORMSTD2 in a PJLLIB resource library.

    If not already created and in use, you will need a PJLLIB PDS library with file attributes RECFM=VB,LRECL=259,BLKSIZE=2594. Add this as a new DD to your CA Spool proc and recycle the task.

    //PJLLIB DD DSN=CAI.ESF.PJLLIB,DISP=SHR

    Note that you have to use CAPS ON command in ISPF Edit and each PJL command requires an "@PJL SET" before each command as well as being coded in EBCDIC. These PJL commands are translated automatically from EBCDIC to ASCII.

    Additions, modifications or deletes of PJLLIB members can be done on the fly. No REINIT and no RECYCLE is required. This library is only read when a file is selected to print on an IP printer that has a print driver option to allow read of the resource library. (See Page 3-137 in the r11.5 Customization Guide, for a list of print drivers and options.)

    See www.hp.com for list of basic PJL commands.
      EDIT       CAI.ESF.PJLLIB( FORMSTD2 )         - 01.01        Columns 00001 00072   Command ===>                                                  Scroll ===> CSR   ****** ***************************** Top of Data *****************************   000001 @PJL SET ORIENTATION=LANDSCAPE                                           000002 @PJL SET FORMLINES=48                                                    000003 @PJL SET LPARM:PCL PITCH=15.00                                           ****** **************************** Bottom of Data *************************** 
  4. Once you have the above completed you can run a print transaction from your online application that will write to the virtual printer called VPRT1 as specified in the NODE for PRT1 to create a new print file.

    NOTE: The code added by APAR QO77734, tagged with the ID TF37520 may also be used by clients as an example of a working model that could be used, if necessary, as a basis for local customization of print exit ESFU009 to update file attributes at print time based on data in the file . Below is a sample of the new code that was added to exit ESFU009.
      000345 *-----------------------------------------------------------* A-TF37520   000346 *  If VPSOPT=15 read 1st record and test for $$FORM=        * A-TF37520   000347 *  and if present move the form name to @#OPGFORM for       * A-TF37520   000348 *  print driver option 3 to use.                            * A-TF37520   000349 *-----------------------------------------------------------* A-TF37520   000350          TM    DCENVPO2,X'02'      VPSOPT=15                  A-TF37520   000351          BZ    FOPENFIN            Continue of no             A-TF37520   000352          NI    R1STFLAG,255-R1STDREC-R1STDRD Reset flags    @ A-TF37520   000353          USING @OPEN,R9            ESFOPEN parmlist access    A-TF37520   000354          LA    R4,R1STPARM         Point to ESFREAD parm area A-TF37520   000355          USING @READ,R4            ESFREAD parmlist access    A-TF37520   000356          MVC   @READCBA,@OPENCBA   Move A(File CBA)           A-TF37520   000357          MVI   @READFLG,@READFLA   Indicate to use @READBUF   A-TF37520   000358          LA    R3,R1STBUF          Point to buffer area       A-TF37520   000359          ST    R3,@READBUF         Set @READBUF               A-TF37520   000360          MVC   @READFNO,@OPENFNO   Set file number            A-TF37520   000361          MVC   @READRCL,=F'512'    Length of buffer area      A-TF37520   000362          ST    R4,R1STLIST         Point to parmlist          A-TF37520   000363          OI    R1STLIST,X'80'      Flag last parm pointer     A-TF37520   000364          LA    R1,R1STLIST         Load -> ESFREAD parmlist   A-TF37520   000365          L     R15,=V(ESFREAD)     Point to ESFREAD EP        A-TF37520   000366          BALR  R14,R15             Link to ESFREAD            A-TF37520   000367          CLC   @READSTA,=CL2' '    Status OK ?                A-TF37520   000368          BNE   FOPENFIN            If not - continue          A-TF37520   000369 FOPENROK DS    0H                                             A-TF37520   000370          LA    R3,12               Load count                 A-TF37520   000371          L     R2,@READBUF         Point to record col 6      A-TF37520   000372 FOPENNC  DS    0H                                             A-TF37520   000373          CLC   0(8,R2),=C'$$FORMS=' Magic keyword present     A-TF37520   000374          BE    FOPEN$$F            Branch if yes              A-TF37520   000375          LA    R2,1(R2)            Bump to next column        A-TF37520   000376          BCT   R3,FOPENNC          Go test it if not col 12   A-TF37520   000377          B     FOPENFIN            Did not find $$FORMS=      A-TF37520   000378 FOPEN$$F DS    0H                                             A-TF37520   000379          MVC   @OPGFORM,8(R2)      Move FORM to ESFOPEN parms A-TF37520   000380          OI    R1STFLAG,R1STDREC   Flag rec to be deleted   @ A-TF37520   000381          B     FOPENFIN            Done - continue            A-TF37520   000382          DROP  R4                                             A-TF37520   000383          DROP  R9                                             A-TF37520