• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Three Ways to Direct OS/400 Output Queues to TCP/IP Printers

    July 24, 2002 Timothy Prickett Morgan

    Dear Readers:

    In shops with TCP/IP networks, a common task is to redirect OS/400 printer output to a TCP/IP printer sitting somewhere else on your network. While the easiest way to configure the printer is by hard coding the IP address inside the printer output queue configuration, that’s not the only way to do it. In fact, there are three different ways to configure an OS/400 TCP/IP remote output queue that I’d like to share with you.

    For this example, let’s look at sending output to a networked TCP/IP printer by using a remote writer that is started through an OS/400 remote output queue. [Note: The concepts I’m discussing here can also be applied to device-based IP printers configured by using the Create Device Description (Printer), CRTDEVPRT command, but I unfortunately don’t have the space to cover CRTDEVPRT TCP/IP configuration in this tip]. Let’s say we’re setting up an OS/400 remote output queue called HPLJ5SI in library QGPL. This new queue will be printing to the RAW remote printer queue of a TCP/IP-connected HP LaserJet 5SI, which has an IP address of 10.0.0.5. To create this output queue and direct it to that address, we would enter the Create Output Queue (CRTOUTQ) command as follows:

    CRTOUTQ  OUTQ(QGPL/HPLJ5SI) +
       RMTSYS(*INTNETADR) RMTPRTQ(RAW) +
       AUTOSTRWTR(1) CNNTYPE(*IP) +
       DESTTYPE(*OTHER) MFRTYPMDL(*HP5SI) +
       INTNETADR('10.0.0.5') +
       TEXT('HP 5SI Outq for Fifth Floor printer')
    

    The Remote System (RMTSYS) value of *INTNETADR combined with the *IP Connection Type (CNNTYPE), a Destination Type of *OTHER (DESTTYPE), and the Internet Address (INTNETADR) of 10.0.0.5 specify that we’ll be redirecting queue output to a TCP/IP printer. The RAW value for the Remote Printer Queue (RMTPRTQ) parameter tells OS/400 to send spool files to the RAW printer queue on our target printer. The Writers to Autostart (AUTOSTRWTR) value of 1 tells OS/400 to automatically start one TCP/IP writer to be used by this remote output queue, and the rest of the parameters describe the print characteristics of the printer this queue will sending information to.

    Once created, OS/400 will automatically start a remote writer associated with this output queue whenever TCP/IP starts or a change is made to this output queue. To end this writer, use the End Writer (ENDWTR) command, as follows:

    ENDWTR WTR(HPLJ5SI)
    

    If you wanted to restart the remote writer, use the Start Remote Writer (STRRMTWTR) command specifying the remote output queue, as follows:

    STRRMTWTR OUTQ(QGPL/HPLJ5SI)
    

    Here’s the downside of hard coding IP addresses into printer output queues: If your destination printer has an IP address change, you have to search all the output queues on your system to find the queue (or queues) that redirect printouts to the old address. If you have multiple AS/400s with multiple TCP/IP-based output queues, locating the proper output queue can be fairly tedious when IP changes occur.

    To slightly ease that burden, you could configure the remote output queue’s IP address by using an OS/400 host table entry for your RMTSYS value. You do this by entering a host table name that’s associated with your printer’s IP address and assigning the host name–not the IP address–to your printer queue. You can create the host table name by opening the Configure TCP/IP menu (GO CFGTCP) and selecting option 10, Work with host table entries. Then you would use option 1=Add on the Work with Host Table Entries screen to enter a new entry that associates your IP address with a unique host table name.

    For our example, assume that we added a host name of FIFTH_FLOOR_HP5SI_PRINTER to our host table, and that name is assigned to IP address 10.0.0.5. Now, if we wanted to create our remote output queue to print to 10.0.0.5 via this host table entry, we would create the remote output queue with the following CRTOUTQ command:

    CRTOUTQ  OUTQ(QGPL/HPLJ5SI) +
       RMTSYS(FIFTH_FLOOR_HP5SI_PRINTER) +
       RMTPRTQ(RAW) AUTOSTRWTR(1) +
       CNNTYPE(*IP) DESTTYPE(*OTHER) +
       MFRTYPMDL(*HP5SI) +
       TEXT('HP 5SI Outq for Fifth Floor printer')
    

    By doing this, we shifted the IP address resolution away from the remote output queue and into the OS/400 host table, where it can be used in multiple objects throughout the system. The remote output queue will now redirect printouts to the TCP/IP address specified in the FIFTH_FLOOR_HP5SI_PRINTER host table entry. If the printer changes its network IP address in the future, we would only have to change our host table entry and the printer would then be redirected to the new address through the FIFTH_FLOOR_HP5SI_PRINTER host name.

    Conversely, if we wanted to change an existing printer queue to use the FIFTH_FLOOR_HP5SI_PRINTER host name, we could use the Change Output Queue (CHGOUTQ) command as follows:

    CHGOUTQ OUTQ(QGPL/HPLJ5SI) +
       RMTSYS(FIFTH_FLOOR_HP5SI_PRINTER) +
       INTNETADR(' ')
    

    This CHGOUTQ command leaves all the other parameters intact while wiping out the original IP address for the queue by blanking out the INTNETADR parameter; it also redirects printer output to the site designated by the FIFTH_FLOOR_HP5SI_PRINTER host table entry.

    While using host table names in your printer output queue descriptions centralizes your IP addresses in one place, it still leaves you with the same problem you have when you hard code the address: If your printer changes IP addresses, you still have to manually change the remote TCP/IP printer’s IP address on your AS/400 (except the change is in the host table this time). To get around that issue, you could also use a DNS entry if one is available for your printer. In fact, using DNS entries inside OS/400 objects is a good practice because a single change to a DNS entry will automatically ripple throughout your network, allowing you to quickly make IP changes without having to incur a lot of manual maintenance. So if you assign a DNS entry for your target printer to your remote output queue, OS/400’s DNS function will do the work of looking up the IP address for you.

    Assigning a DNS name to a printer output queue is functionally the same as using a host table name. So if your HP 5SI printer had an internal DNS name of hp5si.midrangeguru.com and a short DNS alias of HP5SI, you could have your remote output queue resolve that DNS name to an IP address by configuring your queue to point to the DNS alias, as follows:

    CRTOUTQ  OUTQ(QGPL/HPLJ5SI) +
       RMTSYS(HP5SI) RMTPRTQ(RAW) +
       AUTOSTRWTR(1) CNNTYPE(*IP) +
       DESTTYPE(*OTHER) +
       MFRTYPMDL(*HP5SI) +
       TEXT('HP 5SI Outq for Fifth Floor printer')
    

    And if you have DNS lookup configured correctly on your AS/400, your remote output queue will resolve to the IP address of your networked HP 5SI printer. Here’s the upside: Using a DNS name for your remote output queue shifts the IP resolution work away from your AS/400 and on to the network. Here’s the downside: This technique may add a small amount of network traffic as OS/400 DNS communicates across your network to resolve the address.

    So there you have it: Three techniques for setting up a remote output queue that resolves to a TCP/IP-attached printer on your network. And depending on how you want to get your work done, each of these techniques will work equally well.

    — Joe

    Sponsored By
    WORKSRIGHT SOFTWARE

    On June 30, 2002,
    $$$$$$$$    Postal Rates went UP!    $$$$$$$$

    On July 1, 2002,
    $$$$$    you wanted your postage bill to go down.    $$$$$

    We have the solution! CASS certify your mailing names and addresses and presort your outgoing mail and save. Our CASS certification software ensures that your address files have valid ZIP Code and address information. Our presort software ensures that you can properly prepare you mail for delivery to your Post Office.

    WorksRight Software, Inc. is the number-one source for iSeries and AS/400 CASS, presort, ZIP Code, and area code software and data.

    Visit our Web site – www.worksright.com – to learn more about our CASS and presorting software, or contact WorksRight Software, Inc., phone 601-856-8337,
    e-mail software@worksright. com .

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 55 -- July 24, 2002

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Populating JavaBeans from Database Values Generating a Unique Identifier

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 55

This Issue Sponsored By

    Table of Contents

    • Scheduling a Job to Run More than Once a Day
    • Three Ways to Direct OS/400 Output Queues to TCP/IP Printers
    • Did OPNQRYF Retrieve Records?

    Content archive

    • The Four Hundred
    • Four Hundred Stuff
    • Four Hundred Guru

    Recent Posts

    • Liam Allan Shares What’s Coming Next With Code For IBM i
    • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
    • VS Code Will Be The Heart Of The Modern IBM i Platform
    • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
    • IBM i PTF Guide, Volume 27, Number 25
    • Meet The Next Gen Of IBMers Helping To Build IBM i
    • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
    • Will Independent IBM i Clouds Survive PowerVS?
    • Now, IBM Is Jacking Up Hardware Maintenance Prices
    • IBM i PTF Guide, Volume 27, Number 24

    Subscribe

    To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

    Pages

    • About Us
    • Contact
    • Contributors
    • Four Hundred Monitor
    • IBM i PTF Guide
    • Media Kit
    • Subscribe

    Search

    Copyright © 2025 IT Jungle