IBM Support

Configuring a *LAN 3812 Device Description that Uses the LPR Print Driver (TSPLPRD) Exit Program

Troubleshooting


Problem

The TSPLPRD exit program is an unsupported utility that can be used to configure a *LAN 3812 printer device description to send spooled files to an ASCII printer using LPR/LPD. The TSPLPRD exit program uses a printer writer rather than a remote writer.

Resolving The Problem

Note: This document previously was entitled TSPLPRD LPR Print Driver Exit Program.

This document was last updated on 18 July 2014.

Tips for using the TSPLPRD Exit Program

This video provides tips for using the LPR Print Driver (TSPLPRD) utility successfully.


 
Overview

The LPR Print Driver (TSPLPRD) exit program is an unsupported utility that provides the function of using a *LAN 3812 device description and a printer writer, rather than a Remote Output Queue and a remote writer, to send spooled files to an ASCII printer that is attached to an LPD server or to a Microsoft Windows print queue. This is a similar function to what is provided using remote output queues in IBM OS/400 or IBM i5/OS, especially because it communicates using the Line Printer Requester (LPR) and Line Printer Daemon (LPD) protocols; however, it differs because this driver exit program is specified on a printer device description. Thus, it can make use of information specified about the printer in the device description, which is not available on a remote output queue. Also, because it uses LPR/LPD within a printer writer, it supports page ranges and multiple copies, yet can be used with any printer that currently uses a remote output queue, including dot matrix and line printers.

Note: You can also configure the remote output queue first to ensure that it works, then configure the *LAN 3812 device description with comparable settings. If this method is done, use the Work with OUTQ Description (WRKOUTQD) command to display the settings in the remote output queue and note the values used for the Remote system (RMTSYS), Remote printer queue (RMTPRTQ), Internet address (INTNETADR), Manufacturer type and model (MFRTYPMDL), and Workstation customizing object (WSCST) parameters so you know which values to specify when configuring the *LAN 3812 device description.

For information on the capabilities and limitations of Remote Output Queues (RMTOUTQs) and *LAN 3812 printer device descriptions, refer to the following Rochester Support Center knowledgebase documents:

N1019659: Capabilities and Limitations of Remote Output Queues (RMTOUTQs)
N1019003: Capabilities and Limitations of *LAN 3812 Printer Device Descriptions

To get the TSPLPRD utility, do one of the following:
o If running 6.1 (V6R1M0), 7.1 (V7R1M0) or 7.2 (V7R2M0) i5/OS, detach or download the tsplprd-r610.savf file from this document (which file depends on the version of i5/OS), upload it to a save file using an FTP session, and restore the objects from the save file.

Note: If the tsplprd-r530.savf file is uploaded and restored to a system running 6.1, 7.1 or 7.2 i5/OS, or if the tsplprd-r530.savf file has been uploaded and restored to a system running V5R3 or V5R4 i5/OS and that system is later upgraded or migrated to 6.1, 7.1 or 7.2 i5/OS, then the V5R3/V5R4 version of the TSPLPRD utility will need to go through object conversion in order to run on the newer releases. The need for object conversion can be avoided by uploading and restoring the 6.1/7.1/7.2 version of the TSPLPRD utility instead.
o If running 5.3 (V5R3M0 or R530) or 5.4 (V5R4M0 or R540) i5/OS, detach or download the tsplprd-r530.savf file from this document (which file depends on the version of i5/OS), upload it to a save file using an FTP session, and restore the objects from the save file.
o Get the source code from the QUSRTOOL library on an R440 or later OS/400, and compile the source code using the ILE C/400 compiler (ILE C/400 is product 5769CX2 in R4xx and product 5716CX2 in R370).
o Call the Rochester Support Center at 1-800-IBM-SERV, select the appropriate option and ask about opening a consulting agreement PMR to do a remote signon, then have the appropriate version of the TSPLPRD save file sent to you.
o Note: The save files for V5R2 (R520) OS/400 and below (tsplprd-r520.savf, tsplprd-r510.savf and tsplprd-r410.savf) have been removed from this document because these versions are no longer supported. However, the information how to build it is available in an internal document so if one of the older versions are needed, please contact the Rochester Support Center representation or a World Trade support represent.
Technical Support

The LPR Print Driver (TSPLPRD) exit program, and the Set Remote Print Queue (SETRMTPQ) command, are not supported by the Rochester Support Center through Support Line. The TSPLPRD exit program is an unsupported utility that provides the function of sending spooled files from an output queue to an ASCII printer that is attached to an LPD server. The Rochester Support Center can provide assistance with restoring the TSPLPRD utility to an operating system, with configuring a *LAN 3812 device description that uses the TSPLPRD exit program, or with using the Set Remote Print Queue (SETRMTPQ) command, but will not provide assistance with potential defects in the TSPLPRD utility itself.
 



This exit program also serves the purpose of providing an example of a Print Driver Exit because it is written to the Print Driver Exit interface as documented in the AS/400 System API Reference manual.

This exit program was introduced in the R440 version of QUSRTOOL, but will work with R410 and later versions of the operating system. This tool is supplied as is without support. Therefore, any assistance with configuring or using a printer device description that uses an LPR print driver exit program must be done through a consulting agreement.

Note: The TSPLPRD utility uses includes that are shipped with Licensed Program 57xxSS1 Product Option 13 (System Openness Includes) installed. This product is required to be installed if compiling the TSPLPRD source code that is shipped with the QUSRTOOL library, but it is not required to have this product installed if using the TSPLPRD utility from one of the attached save files.
 
 
  • - Getting the LPR Print Driver Exit Program (TSPLPRD) Utility from one of the Attached Save Files



    To restore the TSPLPRD utility from the attached save file, you must create a save file on OS/400 or i5/OS, detach the save file from this document, upload the file to OS/400 or i5/OS using FTP from an MS-DOS prompt and then restore the objects. The resulting TSPLPRD save file contains the following objects:

     
    Object Type Attribute Owner
    TSPLPRCP *PGM CLP QSYS
    TSPLPRD *PGM CLE QSYS
    TSPLPRDC *PGM CLP QSYS
    TSPLPRDD *PGM CLP QSYS
    TSPLPRD *MODULE CLE QSYS
    QATTCL *FILE PF QSYS
    QATTCMD *FILE PF QSYS
    QATTINFO *FILE PF QSYS
    QATTSYSC *FILE PF QSYS
    SETRMTPQ *CMD QSYS


    Additionally, the above source physical files contain the following members:
     
    File Member Type Text
    QATTCL TSPLPRCP CLP Set Remote Print Queue
    QATTCL TSPLPRDC CLP Create LPR Print Drive and associated objects
    QATTCL TSPLPRDD CLP Delete LPR Print Drive and associated objects
    QATTCMD TSPLPRSQ CMD Command Source for TSPLPRD tool
    QATTINFO TSPLPRDI TXT LPR Print Driver Exit Program
    QATTSYSC TSPLPRD C LPR Print Driver Exit Program


    There are two versions of the TSPLPRD save file attached to this document. The version that must be detached/downloaded depends on your version of OS/400 or i5/OS:
     
    File Name Description
    tsplprd-r610.savf New as of 8 March 2012. Contains a fix where the printer writer may fail with message CPF24B4 "Severe error while addressing parameter list" when printing a large spooled file with file separators.
    tsplprd-r540.savf New as of 8 March 2012. Contains a fix where the printer writer may fail with message CPF24B4 "Severe error while addressing parameter list" when printing a large spooled file with file separators.
    tsplprd-r530.savf Contains a number of changes that are specific to V5R3M0 (R530) and V5R4M0 (R540) i5/OS.

    tsplprd-r610.savftsplprd-r610.savftsplprd-r540.savftsplprd-r540.savftsplprd-r530.savf

    Notes:
    o If the tsplprd-r530.savf file is uploaded and restored to a system running 6.1, 7.1 or 7.2 i5/OS, or if the tsplprd-r530.savf file has been uploaded and restored to a system running V5R3 or V5R4 i5/OS and that system is later upgraded or migrated to 6.1, 7.1 or 7.2 i5/OS, then the V5R3/V5R4 version of the TSPLPRD utility will need to go through object conversion in order to run on the newer releases. The need for object conversion can be avoided by uploading and restoring the 6.1/7.1/7.2 version of the TSPLPRD utility instead.
    o The save files for V5R2 (R520) OS/400 and below (tsplprd-r520.savf, tsplprd-r510.savf and tsplprd-r410.savf) have been removed from this document because these versions are no longer supported. However, they are available in an internal document so if one of the older save files are needed, please contact the Rochester Support Center representation or a World Trade support represent.

    Once you have determined which save file is needed, that save file can be uploaded and the LPR Print Driver (TSPLPRD) utility restored to your system by doing the following:

    Once the save file is on your PC, you can upload it to the operating system using FTP as follows:
    1 Create a save file called TSPLPRD using the following Create Save File (CRTSAVF) command:

    CRTSAVF FILE(QGPL/TSPLPRD) TEXT('LPR Print Driver (TSPLPRD)')
    2 Detach/download the appropriate version of the TSPLPRD save file: the tsplprd-r530.savf file for V5R3M0 (R530) or V5R4M0 (R540) i5/OS or the tsplprd-r610.savf file for 6.1 (V6R1M0), 7.1 (V7R1M0) or 7.2 (V7R2M0) i5/OS.
    3 Click on the Windows Start button and selecting All Programs > Accessories > Command Prompt.
    4 Use the CD command to connect to the folder that contains the save file (for example, type CD C:\Temp if the save file was saved in the Temp folder).
    5 Type FTP <as400-system-name> to start an FTP session to OS/400 or i5/OS. Sign on using your OS/400 or i5/OS user profile and password.
    6 Type BIN at the FTP prompt to force the data transmission to binary data.
    7 Type CD QGPL to change the working directory to the QGPL library (or the library where the save file was generated).

    Note: If this fails with an error that says the library was not found, it could be caused by the FTP attributes on the OS/400 or i5/OS being setup with the Initial name format (NAMEFMT) parameter set to *PATH rather than *LIB, or in other words FTP might be setup to connect to the Integrated File System rather than to the library structure. Use the Change FTP Attributes (CHGFTPA) command to check on this or even change the setting, or you can try typing CD /QSYS.LIB/QGPL.LIB instead. Another option would be to try typing QUOTE SITE NAMEFMT 0 and then typing CD QGPL.
    8 Type the appropriate SEND command at the FTP prompt to send the save file from the PC to the TSPLPRD save file on the operating system:

    For 6.1 (V6R1M0), 7.1 (V7R1M0) or 7.2 (V7R2M0) i5/OS, type SEND TSPLPRD-R610.SAVF TSPLPRD
    For V5R3M0 (R530) or V5R4M0 (R540) i5/OS, type SEND TSPLPRD-R530.SAVF TSPLPRD

    Note: If using NAMEFMT 1, type QUOTE SITE NAMEFMT 0 to change to NAMEFMT 0 or type one of the following commands instead:

    For 6.1 (V6R1M0), 7.1 (V7R1M0) or 7.2 (V7R2M0) i5/OS, type SEND TSPLPRD-R610.SAVF TSPLPRD.FILE
    For V5R3M0 (R530) or V5R4M0 (R540) i5/OS, type SEND TSPLPRD-R530.SAVF TSPLPRD.FILE
    9 Type QUIT to end the FTP session.
    10 Type EXIT to close the Windows Command Prompt.
    11 Use the DSPSAVF FILE(QGPL/TSPLPRD) command on an operating system command line to verify that the file has been uploaded to the operating system successfully. If unsuccessful, repeat steps 1 through 8 above.
    12 After the PC file has been successfully uploaded to the TSPLPRD save file on the operating system, you can restore the objects from the TSPLPRD save file to the QGPL library using the following Restore Object (RSTOBJ) command:

    RSTOBJ OBJ(*ALL) SAVLIB(TSPLPRD) DEV(*SAVF) OBJTYPE(*ALL)
           SAVF(QGPL/TSPLPRD) RSTLIB(QGPL)

    Note: The TSPLPRD program, or *PGM object, has the adopt authority attribute set. If message CPD373F "TSPLPRD in library QGPL with adopt authority attribute not restored" is received when running the above RSTOBJ command, temporarily change the Allow Object Restore (QALWOBJRST) system value to specify either *ALWPGMADP (which allows programs and service programs with the adopt attribute to be restored) or *ALL (which allows all objects to be restored regardless of whether or not they have security-sensitive attributes or validation errors), run the above RSTOBJ command again, and then change the QALWOBJRST system value back to its previous settings.
  • - Getting the LPR Print Driver Exit Program (TSPLPRD) Utility from the QUSRTOOL Library



    The source code for the LPR Print Driver utility is in member TSPLPRD in the QATTSYSC file, which is available in the QUSRTOOL library starting in V4R4 (R440) OS/400. The instructions for compiling the source code are in member TSPLPRDI in the QATTINFO file, which is also available in the QUSRTOOL library.



  • - Limitations of the LPR Print Driver Exit Program (TSPLPRD) Utility



    Use of Several Application Programming Interfaces (APIs)

    The LPR Print Driver Exit Program (TSPLPRD) print utility uses several Application Programming Interfaces (APIs) that access the spooled files being sent. Because of this, it must have sufficient authority to the output queue, the output queue library, the printer device description, and the spooled file itself. Refer to the information on the Open Spooled File (QSPOPNSP) API in the System API Reference manual for the level of authority needed. For more information, refer to the following:

    OS/400 APIs within the IBM iSeries Information Center, which is available at the following Web site:

    http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/apis/api.htm

    Print APIs (V5R2), which is available at the following Web site:

    http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/print.pdf

    Authority Issues

    One possible way of insuring this exit program has authority to process all spooled files is to use the Change Program (CHGPGM) command to change the TSPLPRD program to have it adopt the owner's authority, and use the Change Object Owner (CHGOBJOWN) command to change the owner of the program to be a user profile which has sufficient authority, such as QSYS, for example:

    CHGOBJOWN OBJ(QGPL/TSPLPRD) OBJTYPE(*PGM) NEWOWN(QSYS)
              CUROWNAUT(*REVOKE)

    CHGPGM PGM(QGPL/TSPLPRD) USRPRF(*OWNER) USEADPAUT(*YES)

    Note: It might also be necessary to use the Change Command (CHGCMD) command to change the SETRMTPQ command to point to the TSPLPRCP command processing program in library QGPL, for example:

    CHGCMD  CMD(QGPL/SETRMTPQ)  PGM(*LIBL/TSPLPRCP)

    Press the Enter key.

    TSPLPRD is an Unsupported Utility and SETRMTPQ is an Unsupported Command

    As stated above, the LPR Print Driver (TSPLPRD) exit program and the Set Remote Print Queue (SETRMTPQ) command, are not supported by the Rochester Support Center through Support Line. The TSPLPRD exit program is an unsupported utility that provides the function of sending spooled files from an output queue to an ASCII printer that is attached to an LPD server. The Rochester Support Center can provide assistance with restoring the TSPLPRD utility to an operating system, with configuring a *LAN 3812 device description that uses the TSPLPRD exit program, or with using the Set Remote Print Queue (SETRMTPQ) command, but will not provide assistance with potential defects in the TSPLPRD utility itself.

    Transformed Data Buffer Size Limit of 2MB

    There is a 2MB limit on the amount of transformed data that can be in a single buffer. A single spooled file record is usually 4096 or 512 bytes in size, but the transformed data can be much larger than that. It could potentially run into the 2MB limitation if you are including a number of page segments or something else that results in a large ratio of transformed data per spooled file data.

  • - Configuration Instructions



    To configure such devices, use the CRTDEVPRT command. The following parameters should be specified:

    Device Class (DEVCLS)
    This must be set to *LAN.

    Device Type (TYPE)
    This must be set to 3812.

    Device Model (MODEL)
    This must be set to 1.

    LAN Attachment (LANATTACH)
    This is set to *IP for *LAN 3812 PJL and SNMP device descriptions, as well as *LAN *IPDS device descriptions, but must be set to *USRDFN for *LAN 3812 device descriptions that use the LPR Print Driver Exit Program (TSPLPRD) print utility.

    Port number (PORT)
    This must be set to 0.

    Font (FONT) = 011
    This is typically set to 011, which is the default 10 CPI font. A font ID is required to create the device description. Unless special requirements in your operation dictate something different, this should suffice.

    Form Feed (FORMFEED)
    This defaults to *TYPE, but should be set to *AUTOCUT or *CONT, depending on the type of printer. If the printer is a laser, ink jet, dot matrix, or line printer that has an automatic sheet feeder, then this should be set to *AUTOCUT. If the printer is a dot matrix or line printer that uses continuous form or tractor-feed paper, then this should be set to *CONT instead.

    Printer Error Message (PRTERRMSG)
    This defaults to *INQ. For R410 OS/400 and above, this should be set to *INFO so the printer's message queue will receive informational messages whenever possible. If this is set to *INQ and a problem occurs on the printer (such as out of forms or a paper jam) a message will be sent to the printer's message queue that must be answered before printing can continue. Often, this can also cause the writer to end while in the middle of a spooled file.

    Message queue (MSGQ)
    This defaults to *CTLD, which indicates the message queue defined in the attached controller. There is no attached controller for *LAN printer device descriptions, so leaving the Message queue (MSGQ) parameter set to *CTLD will in affect set it to the QSYSOPR message queue in library QSYS. If another message queue is to be used for this particular printer device, verify that the message queue exists before entering the message queue and library in the MSGQ parameter. Otherwise, the CRTDEVPRT command will fail with message CPF2799 - Message queue &1 in library &2 not found.

    Activation Timer (ACTTMR)
    This defaults to 170 (seconds), but can be set to any value from 1 to 2550 seconds (or 42.5 minutes). The activation timer refers to the amount of time to wait for the LAN-attached printer device to respond. The printer device is considered not available, and an error message is posted if there is no connection before this timer expires.

    Inactivity Timer (INACTTMR)
    This defaults to *ATTACH, but can be set to any value from 1 to 30 (minutes), as well as *SEC15 (15 seconds), *SEC30 (30 seconds) or *NOMAX (no maximum). This value determines when the print driver closes the connection to the printer (freeing it up to received spooled output from another source) once there are no OS/400 or i5/OS spooled files left in RDY (ready) status. It is recommended that this be set to *SEC15 so the operating system will free up the printer 15 seconds after all RDY spooled files have been processed. Setting it to *NOMAX will cause the operating system to maintain the connection until the writer is ended, so the printer device will not be shared with other systems. For *LAN printer device descriptions, *ATTACH maps to the recommended value of *SEC15.

    Host Print Transform (TRANSFORM)
    This must be set to *YES so the operating system's Host Print Transform (HPT) function will convert SCS, and potentially AFPDS, spooled files to the printer's data stream.

    Manufacturer Type and Model (MFRTYPMDL)
    This indicates the type of ASCII printer being used. This value is used by HPT to determine what ASCII controls to use when converting the spooled file from SCS or AFPDS to ASCII. For recommendations on the value to use for certain known printers, refer to the following Rochester Support Center knowledgebase document:

    New, Information on Printers from Various Manufacturers:

    Paper source 1 (PPRSRC1) and Paper source 2 (PPRSRC2)
    These parameters indicate the paper size used in paper source 1 and paper source 2 in the printer hardware. The default value is *MFRTYPMDL, which indicates that the paper size will be determined based on the default paper size for the Manufacturer type and model (MFRTYPMDL) setting selected. Other choices for the PPRSRC1 and PPRSRC2 parameters include the following:

     
    *LETTER Letter sized (8.5 x 11 inch) paper
    *LEGAL Legal sized (8.5 x 14 inch) paper
    *LEDGER Ledger sized (11 x 17 inch) paper
    *EXECUTIVE Executive sized (7.25 x 10.5 inch) paper
    *A3 A3 sized 297mm x 420mm (11.7 x 16.5 inch) paper
    *A4 A4 sized 210mm x 297mm (8.3 x 11.7 inch) paper
    *A5 A5 sized 148mm x 210mm (5.85 x 8.3 inch) paper
    *B4 B4 sized 250mm x 353mm(10.1 x 14.3 inch) paper
    *B5 B5 sized 176mm x 250mm (7.2 x 10.1 inch) paper
    *CONT80 Continuous form (8.0 inches)
    *CONT132 Continuous form (13.2 inches)
    *NONE No paper source specified

    Note: If the *LAN 3812 device description is being configured for a continuous form printer, such as an IBM 6400 line matrix printer, set the PPRSRC1 parameter to *CONT80 or *CONT132. Using *CONT132 rather than *CONT80 can ensure that spooled files will not be printed in a condensed or compressed font because of Computer Output Reduction (COR) processing. Also, the PPRSRC2 should typically be set to *NONE, unless the continuous form printer has a second tractor feed path.

    Remote Location (RMTLOCNAME)
    This should be set to the printer's TCP/IP address, host name or DNS name. If a TCP/IP address is used, it should be entered without leading zeros (for example, use 192.186.10.2 rather than 192.186.010.002). If a TCP/IP address is used, verify that the operating system can reach the printer by using either the PING or Verify TCP/IP Connection (VFYTCPCNN) command with that TCP/IP address. If a host name or DNS name is used, verify that the operating system can reach the printer by using either the PING or Verify TCP/IP Connection (VFYTCPCNN) command with that host name or DNS name.

    User-defined options (USRDFNOPT)
    This defaults to *NONE, but can be used to specify a particular LPR filter, such as 'f' (Print formatted file) or 'l' (Print file leaving control characters). For more information on this, refer to the section entitled Specifying LPR Filters in the User-defined options (USRDFNOPT) Parameter in the Printer Device Description below.

    User-defined driver program (USRDRVPGM)
    Specifies the qualified name of a user-defined data program that is used to transform the spooled file data, which provides the capability to send OS/400 or i5/OS printer output to a printer attached over a TCP/IP network. This must be set to TSPLPRD in library QGPL when configuring a *LAN 3812 device description that uses the LPR Print Driver Exit Program (TSPLPRD) print utility.

    Workstation Customizing Object (WSCST)
    This is typically set to *NONE, but can be used to specify a modified Workstation Customizing Object (WSCST).

    Text 'description' (TEXT)
    Specifies the text that briefly describes the printer device description. This text can be seen when working with printer device descriptions when using the Work with Device Descriptions (WRKDEVD) command.

    Note: All other parameters should be specified like any other printer.

    After the *LAN 3812 device description has been created, the Set Remote Print Queue (SETRMTPQ) command must be used to specify the remote printer queue name that would normally be specified on a remote output queue for that same printer. For more information on this, refer to the section entitled Specifying the Remote Printer Queue Name using the SETRMTPQ Command below.
  • - Configuration Example for a Continuous Form Printer



    The following is an example of using the Create Device Printer (CRTDEVPRT) command to configure a *LAN 3812 device description that uses the LPR Print Driver Exit Program (TSPLPRD) print utility to print to a continuous form printer. This particular example is for an IBM 6400 line matrix printer. To follow along with this example, type CRTDEVPRT on an operating system command line and press the F4 (Prompt) key.

    Note: A few continuous form printers (namely the IBM 6400 and IBM 4247 line matrix printers) can be configured using *LAN 3812 SNMP device descriptions. Because *LAN 3812 SNMP device descriptions are supported, and the LPR Print Driver Exit Program (TSPLPRD) print utility is not, it is recommended that you try using SNMP before using TSPLPRD. To determine whether a particular printer supports SNMP, refer to the following document:

    N1019605: Information on Printers from Various Manufacturers

    Note: The actual settings needed for any particular printer can be different than the settings used in this example.



     
                        Create Device Desc (Printer) (CRTDEVPRT)

     Type choices, press Enter.

     Device description . . . . . . . > IBM6400       Name
    Device class . . . . . . . . . . >
    *LAN          *LCL, *RMT, *VRT, *SNPT, *LAN
    Device type  . . . . . . . . . . >
    3812          3287, 3812, 4019, 4201...
    Device model . . . . . . . . . . >
    1             0, 1, 2, 3, 4, 10, 13, 301...
    LAN attachment . . . . . . . . . >
    *USRDFN       *LEXLINK, *IP, *USRDFN
    Switched line list . . . . . . .  
                  Name
                   + for more values  
             
    LAN remote adapter address . . .                 000000000001-FFFFFFFFFFFE
    Adapter type . . . . . . . . . .  
    *INTERNAL     *INTERNAL, *EXTERNAL
    Port number  . . . . . . . . . . >
    0             0-65535
    Online at IPL  . . . . . . . . .  
    *YES          *YES, *NO
    Font:
      Identifier . . . . . . . . . . >
    11            3, 5, 11, 12, 13, 18, 19...
      Point size . . . . . . . . . .  
    *NONE         000.1-999.9, *NONE
    Form feed  . . . . . . . . . . . >
    *CONT         *TYPE, *CONT, *CONT2, *CUT...
    Separator drawer . . . . . . . .  
    *FILE         1-255, *FILE
                                                                            More...
     F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display
     F24=More keys
                        Create Device Desc (Printer) (CRTDEVPRT)

     Type choices, press Enter.

     Separator program  . . . . . . .   *NONE         Name, *NONE
       Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB
    Printer error message  . . . . . >
    *INFO         *INQ, *INFO
    Message queue  . . . . . . . . .  
    *CTLD         Name, *CTLD, *SYSOPR, QSYSOPR
      Library  . . . . . . . . . . .    
                Name, *LIBL, *CURLIB
    Activation timer . . . . . . . .  
    170           1-2550, *NOMAX
    Inactivity timer . . . . . . . . >
    *SEC15        1-30, *ATTACH, *NOMAX...
    Host print transform . . . . . . >
    *YES          *NO, *YES
    Manufacturer type and model  . . >
    *IBM6400        
    Paper source 1 . . . . . . . . . > *CONT132      *MFRTYPMDL, *LETTER...
    Paper source 2 . . . . . . . . .  
    *MFRTYPMDL    *MFRTYPMDL, *LETTER...
    Envelope source  . . . . . . . .  
    *MFRTYPMDL    *MFRTYPMDL, *MONARCH...
    ASCII code page 899 support  . .  
    *NO           *NO, *YES
    Image configuration  . . . . . .  
    *NONE         *NONE, *IMGA01, *IMGA02...
                                                                            More...
     F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display
     F24=More keys
                        Create Device Desc (Printer) (CRTDEVPRT)

     Type choices, press Enter.

     Character identifier:
      Graphic character set  . . . .  
    *SYSVAL       1-32767, *SYSVAL
      Code page  . . . . . . . . . .  
                  1-32767
    Remote location:

       Name or address  . . . . . . . > '192.168.13.251'                            
                                                                                   
                                                                                   
                                                       
    User-defined options . . . . . .   *NONE         Character value, *NONE
                   + for more values  
             
    User-defined object:
      Object . . . . . . . . . . . .  
    *NONE         Name, *NONE
        Library  . . . . . . . . . .    
                Name, *LIBL, *CURLIB
      Object type  . . . . . . . . .  
                  *DTAARA, *DTAQ, *FILE...
    Data transform program . . . . .  
    *NONE         Name, *NONE
      Library  . . . . . . . . . . .    
                Name, *LIBL, *CURLIB
                                                                            More...
     F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display
     F24=More keys
                        Create Device Desc (Printer) (CRTDEVPRT)

     Type choices, press Enter.

     User-defined driver program  . . > TSPLPRD       Name, *NONE
      Library  . . . . . . . . . . . >  
    QGPL        Name, *LIBL, *CURLIB
    Secure connection  . . . . . . .  
    *NO           *NO, *YES
    Validation list  . . . . . . . .  
    *NONE         Name, *NONE
      Library  . . . . . . . . . . .    
                Name, *LIBL, *CURLIB
    Publishing information:
      Support duplex . . . . . . . .  
    *UNKNOWN      *UNKNOWN, *SIMPLEX, *DUPLEX
      Support color  . . . . . . . .  
    *UNKNOWN      *UNKNOWN, *NOCOLOR, *COLOR
      Pages per minute black . . . .  
    *UNKNOWN      1-32767, *UNKNOWN
       Pages per minute color . . . .   *UNKNOWN      1-32767, *UNKNOWN
      Location . . . . . . . . . . .  
    *BLANK                          
      Data streams supported . . . .   *UNKNOWN      *UNKNOWN, *PCL, *PS, *PDF...
                   + for more values  
           
    Text 'description' . . . . . . .   '*LAN 3812 DEVD for IBM 6400 (TSPLPRD)'    
         

                                                                            More...
     F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display
     F24=More keys
                        Create Device Desc (Printer) (CRTDEVPRT)

     Type choices, press Enter.


                                Additional Parameters                            
                                                                                 
     Remote network identifier  . . .   *NETATR       Name, *NETATR, *NONE        
     Workstation customizing object     *NONE         Name, *NONE                
       Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB        
     Authority  . . . . . . . . . . .   *CHANGE       Name, *CHANGE, *ALL, *USE...









                                                                             Bottom
     F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display
     F24=More keys

    The resulting CRTDEVPRT command would be:

    CRTDEVPRT  DEVD(IBM6400)  DEVCLS(*LAN)  TYPE(3812)  MODEL(1)
               LANATTACH(*USRDFN)  PORT(0)  FONT(11)  FORMFEED(*CONT)
               PRTERRMSG(*INFO)  TRANSFORM(*YES)  MFRTYPMDL(*IBM6400)
               PPRSRC1(*CONT132)  RMTLOCNAME('192.168.13.251')
               USRDRVPGM(QGPL/TSPLPRD)
               TEXT('*LAN 3812 TSPLPRD DEVD for IBM 6400')

    After you have created the printer device description, you must do the following:
     
    1 Use the Set Remote Print Queue (SETRMTPQ) command to specify the name of the LPR print queue needed for the printer. For more information on this, refer to the section entitled Using the SETRMTPQ Command to Specify the Remote Printer Queue or LPR Queue Name below.

    In the case of an IBM 6400 line matrix printer with an internal print server, this value would most likely be 'd1prn'. To set this special value into the user defined data portion of the printer device description, the following Set Remote Print Queue (SETRMTPQ) command would be used:

    SETRMTPQ  DEVD(printer-device-name)  RMTPRTQ('d1prn')
    2 Vary on the printer device description using either the Vary Configuration (VRYCFG) or Work with Configuration Status (WRKCFGSTS) command.
    3 Start the printer writer using either the Start Printer Writer (STRPRTWTR) or Option 1 (Start) from the Work with Writers (WRKWTR) command.
    Note: If you do not know the value to specify for the RMTPRTQ value, but are already using a *LAN 3812 TSPLPRD device description for this printer on another system, you can see what value is specified by running the Dump System Object (DMPSYSOBJ) command. For example:

    DMPSYSOBJ OBJ(QDCDEVdevice_name) CONTEXT(QSYS)

    where 'device_name' is the name of the printer device description. Next, do a "WRKJOB JOB(*) OPTION(*SPLF)" and display the resulting QPSRVDMP spooled file. The eye catcher in the system dump will show RMTPRTQ('xxxxxxxx') where 'xxxxxxxx' is the value current being used.
  • - Configuration Example for a Cut-Sheet Printer



    The following is an example of using the Create Device Printer (CRTDEVPRT) command to configure a *LAN 3812 device description that uses the LPR Print Driver Exit Program (TSPLPRD) print utility to print to a cut-sheet printer. This particular example is for an IBM Infoprint 1140 laser printer. To follow along with this example, type CRTDEVPRT on an operating system command line and press the F4 (Prompt) key.

    Note: Many cut-sheet laser printers (including the IBM Infoprint 1140) can be configured using either *LAN 3812 PJL device descriptions, *LAN 3812 SNMP device descriptions, or both. Because *LAN 3812 PJL and SNMP device descriptions are supported, and the LPR Print Driver Exit Program (TSPLPRD) print utility is not, it is recommended that you try using PJL or SNMP before using TSPLPRD. To determine whether a particular printer supports PJL or SNMP, refer to the following document:

    New, Information on Printers from Various Manufacturers:

    Note: The actual settings needed for any particular printer can be different than the settings used in this example.


                       Create Device Desc (Printer) (CRTDEVPRT)

    Type choices, press Enter.

    Device description . . . . . . . > IBMIP1140     Name
    Device class . . . . . . . . . . > *LAN          *LCL, *RMT, *VRT, *SNPT, *LAN
    Device type  . . . . . . . . . . > 3812          3287, 3812, 4019, 4201...
    Device model . . . . . . . . . . > 1             0, 1, 2, 3, 4, 10, 13, 301...
    LAN attachment . . . . . . . . . > *USRDFN       *LEXLINK, *IP, *USRDFN
    Switched line list . . . . . . .                 Name
                  + for more values
    LAN remote adapter address . . .                 000000000001-FFFFFFFFFFFE
    Adapter type . . . . . . . . . .   *INTERNAL     *INTERNAL, *EXTERNAL
    Port number  . . . . . . . . . . > 0             0-65535
    Online at IPL  . . . . . . . . .   *YES          *YES, *NO
    Font:
     Identifier . . . . . . . . . . > 11            3, 5, 11, 12, 13, 18, 19...
     Point size . . . . . . . . . .   *NONE         000.1-999.9, *NONE
    Form feed  . . . . . . . . . . . > *AUTOCUT      *TYPE, *CONT, *CONT2, *CUT...
    Separator drawer . . . . . . . .   *FILE         1-255, *FILE
    Separator program  . . . . . . .   *NONE         Name, *NONE

      Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB
    Printer error message  . . . . . > *INFO         *INQ, *INFO
    Message queue  . . . . . . . . .   *CTLD         Name, *CTLD, *SYSOPR, QSYSOPR
     Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB
    Activation timer . . . . . . . .   170           1-2550, *NOMAX
    Inactivity timer . . . . . . . . > *SEC15        1-30, *ATTACH, *NOMAX...
    Host print transform . . . . . . > *YES          *NO, *YES
    Manufacturer type and model  . . > *INFOPRINT1140
    Paper source 1 . . . . . . . . . > *LETTER       *MFRTYPMDL, *LETTER...
    Paper source 2 . . . . . . . . . > *LETTER       *MFRTYPMDL, *LETTER...
    Envelope source  . . . . . . . .   *MFRTYPMDL    *MFRTYPMDL, *MONARCH...
    ASCII code page 899 support  . .   *NO           *NO, *YES
    Image configuration  . . . . . .   *NONE         *NONE, *IMGA01, *IMGA02...
    Character identifier:
     Graphic character set  . . . .   *SYSVAL       1-32767, *SYSVAL
     Code page  . . . . . . . . . .                 1-32767
    Remote location:

      Name or address  . . . . . . . > '192.168.13.251'
    User-defined options . . . . . .   *NONE         Character value, *NONE
                  + for more values
    User-defined object:
     Object . . . . . . . . . . . .   *NONE         Name, *NONE
       Library  . . . . . . . . . .                 Name, *LIBL, *CURLIB
     Object type  . . . . . . . . .                 *DTAARA, *DTAQ, *FILE...
    Data transform program . . . . .   *NONE         Name, *NONE
     Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB
    User-defined driver program  . . > TSPLPRD       Name, *NONE
     Library  . . . . . . . . . . . >   QGPL        Name, *LIBL, *CURLIB
    Secure connection  . . . . . . .   *NO           *NO, *YES
    Validation list  . . . . . . . .   *NONE         Name, *NONE
     Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB
    Publishing information:
     Support duplex . . . . . . . .   *UNKNOWN      *UNKNOWN, *SIMPLEX, *DUPLEX
     Support color  . . . . . . . .   *UNKNOWN      *UNKNOWN, *NOCOLOR, *COLOR
     Pages per minute black . . . .   *UNKNOWN      1-32767, *UNKNOWN

      Pages per minute color . . . .   *UNKNOWN      1-32767, *UNKNOWN
     Location . . . . . . . . . . .   *BLANK
     Data streams supported . . . .   *UNKNOWN      *UNKNOWN, *PCL, *PS, *PDF...
                  + for more values
    Text 'description' . . . . . . .   '*LAN 3812 DEVD for IBM IP1140 (TSPLPRD)'


    The resulting CRTDEVPRT command would be:

    CRTDEVPRT DEVD(IBMIP1140)  DEVCLS(*LAN)  TYPE(3812)  MODEL(1)
              LANATTACH(*USRDFN)  PORT(0)  FONT(11)  FORMFEED(*AUTOCUT)
              PRTERRMSG(*INFO)  TRANSFORM(*YES)  MFRTYPMDL(*INFOPRINT1140)
              PPRSRC1(*LETTER)  PPRSRC2(*LETTER)  RMTLOCNAME('192.168.13.251')
              USRDRVPGM(QGPL/TSPLPRD)
              TEXT('*LAN 3812 TSPLPRD DEVD for IBM IP1140')

    Once you have created the printer device description, you must do the following:

     
    1 Use the Set Remote Print Queue (SETRMTPQ) command to specify the name of the LPR print queue needed for the printer. For more information on this, refer to the section entitled Using the SETRMTPQ Command to Specify the Remote Printer Queue or LPR Queue Name below.

    In the case of an IBM Infoprint 1140 printer with an internal print server, this value would be '/prt0'. To set this special value into the user defined data portion of the printer device description, the following Set Remote Print Queue (SETRMTPQ) command would be used:

    SETRMTPQ DEVD(printer-device-name) RMTPRTQ('/prt0')
    2 Vary on the printer device description using either the Vary Configuration (VRYCFG) or Work with Configuration Status (WRKCFGSTS) command.
    3 Start the printer writer using either the Start Printer Writer (STRPRTWTR) or Option 1 (Start) from the Work with Writers (WRKWTR) command.
    Note: If you do not know the value to specify for the RMTPRTQ value, but are already using a *LAN 3812 TSPLPRD device description for this printer on another system, you can see what value is specified by running the Dump System Object (DMPSYSOBJ) command. For example:

    DMPSYSOBJ OBJ(QDCDEVdevice_name) CONTEXT(QSYS)

    where 'device_name' is the name of the printer device description. Next, do a "WRKJOB JOB(*) OPTION(*SPLF)" and display the resulting QPSRVDMP spooled file. The eye catcher in the system dump will show RMTPRTQ('xxxxxxxx') where 'xxxxxxxx' is the value current being used.
  • - Using the SETRMTPQ Command to Specify the Remote Printer Queue or LPR Queue Name



    To use the TSPLPRD print driver with a printer device description, the user-defined data portion of the printer device description must be set to a special value that refers to the LPR queue name needed to print to the LAN attached printer using the Line Printer Requester (LPR) protocol. This is the same value that would normally be specified in the Remote printer queue (RMTPRTQ) parameter in a remote output queue for that same printer. This special value must not exceed 255 bytes in length, and can be set using the following Set Remote Print Queue (SETRMTPQ) command:

    SETRMTPQ DEVD(printer-device-name) RMTPRTQ('remote-printer-queue-name')

    As stated above, this value corresponds to the LPR queue name that would normally be specified on a remote output queue in the RMTPRTQ parameter. If a remote output queue is already configured for this printer, use the Work with OUTQ Description (WRKOUTQD) command to display the settings for the remote output queue and use the same value that is specified in the RMTPRTQ parameter. If a remote output queue is not already configured for this printer, refer to the following document for a list of recommended values for the Remote Printer Queue (RMTPRTQ) parameter:

    N1010172: Recommended Remote Printer Queue Values for Remote Output Queues (RMTOUTQs)

    Notes:

    o If the printer device description is backed up and restored to another IBM i system, or restored to the same system after deleting the printer device description, the RMTPRTQ should still be specified in the device description. However, it is recommended that you confirm this by running the Dump System Object (DMPSYSOBJ) command. For example:

    DMPSYSOBJ OBJ(QDCDEVdevice_name) CONTEXT(QSYS)

    where 'device_name' is the name of the printer device description. Next, do a "WRKJOB JOB(*) OPTION(*SPLF)", displaying the resulting QPSRVDMP spooled file, and confirming that the eye catcher in the system dump shows RMTPRTQ('xxxxxxxx') where 'xxxxxxxx' is the value that you had specified initially in the SETRMTPQ command.
    o The Retrieve Configuration Source (RTVCFGSRC) command can be used to retrieve the CL source statements which describe existing configuration objects, such as *LAN 3812 printer device descriptions. However, it will only retrieve the CRTDEVPRT command needed to recreate the device, it will not include the SETRMTPQ command needed to set the Remote printer queue (RMTPRTQ) parameter.

    Example for an IBM 6400 Line Matrix Printer

    In the case of an IBM 6400 line matrix printer with an internal print server, this value would most likely be 'd1prn'. To set this special value into the user defined data portion of the printer device description, the following Set Remote Print Queue (SETRMTPQ) command would be used:

    SETRMTPQ DEVD(printer-device-name) RMTPRTQ('d1prn')


    Example for an IBM Infoprint 1140 Laser Printer

    In the case of an IBM Infoprint 1140 printer with an internal print server, this value would be '/prt0'. To set this special value into the user defined data portion of the printer device description, the following Set Remote Print Queue (SETRMTPQ) command would be used:

    SETRMTPQ DEVD(printer-device-name) RMTPRTQ('/prt0')
    o If message CPD0028 "Library TSPLPRD not found" is received when using the Set Remote Print Queue (SETRMTPQ) command, use the following command to change the Set Remote Print Queue (SETRMTPQ) command so that it points to the TSPLPRCP program in library QGPL, rather than the TSPLPRCP program in library TSPLPRD:

    CHGCMD CMD(QGPL/SETRMTPQ) PGM(QGPL/TSPLPRCP)
    o Failure to run the Set Remote Print Queue (SETRMTPQ) command for one of the new device descriptions will cause the writer to fail with message CPF9898 -REMOTE PRINTER QUEUE NOT SPECIFIED IN USRDFNDTA OF PRINTER DEVICE.
  • - Creating Additional *LAN 3812 Device Descriptions that Use the TSPLPRD Utility



    When creating several *LAN 3812 device descriptions that use the TSPLPRD utility, the first one can be created by following the configuration instructions and configuration examples above, then the others can be created by using the Work with Device Descriptions (WRKDEVD) command with DEVD(*LANPRT) or DEVD(printer-name) and selecting Option 3 (Copy). This will prompt the Create Device Desc (Printer) (CRTDEVPRT) command with the same settings as the original *LAN 3812 device description, except that the Device description (DEVD) parameter will be left blank to force you to specify a new printer device description name. All of the other settings will be same as the device description that you copied, so if you are dealing with similar printers then all you might need to change is the Remote location (RMTLOCNAME) parameter.

    This will work to create additional *LAN 3812 device descriptions. However, the Set remote print queue (SETRMTPQ) command must still be used for each new device description created so the LPR queue name, or the Remote printer queue (RMTPRTQ) parameter from the remote output queue, is specified for each new device description as well. Failure to run the SETRMTPQ command for one of the new device descriptions will cause the writer to fail with message CPF9898 - REMOTE PRINTER QUEUE NOT SPECIFIED IN USRDFNDTA OF PRINTER DEVICE.

  • - Specifying LPR Filters in the User-defined options (USRDFNOPT) Parameter in the Printer Device Description



    In addition, if you would like to specify a particular LPR filter, such as 'f' (Print formatted file) or 'l' (Print file leaving control characters), it can be specified in the User-defined options (USRDFNOPT) parameter in the printer device description using the Change Device Desc (Printer) (CHGDEVPRT) command. For example, use the following CHGDEVPRT command to specify the 'f' filter:

    CHGDEVPRT DEVD(printer-device-name) USRDFNOPT('FILTER(f)')

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

18762910

Document Information

Modified date:
03 November 2021

UID

nas8N1019586