How to set the IP address in the AS/400

Problem:
I have upgraded to a new computer. Now, when I try to print from the AS/400, the job never makes it to my RPM queue. Is there something I need to do when upgrading PCs or changing the IP addressing scheme?
Answer:
There are two common causes to this problem.
  1. The new computer typically has a different IP address than the previous RPM host computer. To resolve this, you must configure the AS/400 OUTQ with the IP address of your new RPM computer.
  2. From an AS/400 command prompt, issue this command, substituting your OUTQ name where appropriate: ENDWTR outq name *IMMED.
  3. Wait 15 seconds, then issue this command, again substituting your OUTQ name where appropriate: CHGOUTQ outq name. Press F4 to prompt, as opposed to the Enter key. If you press the Enter key, start again from the beginning.
  4. In the Change Output Queue screen, press F9. Verify the Remote system parameter is set to *INTNETADR (or to the DNS hostname of your new RPM host).
  5. Locate the Internet Address parameter. Enter the IP address of the new computer. Do not use single quotes or an asterisk (*).
  6. Now, press Enter. If the Writers to autostart parameter is greater than zero, the writer for this OUTQ will start automatically and printing will begin. If not, you must enter the following command to start the writer: STRRMTWTR outq_name. Press Enter.
  7. The other most common problem is that the computer has a firewall installed. Printing from the AS/400 to RPM requires the firewall to allow incoming data on port 515. For instructions on configuring the Windows XP Service Pack 2 firwall, click here.

How do I print labels from the AS/400

Problem:
How do I print labels to a "label printer", commonly called thermal printer, from the AS/400?
Answer:
There are two main keys to printing through RPM to a label printer from the AS/400. First, you must have a Windows print driver, and secondly, some specific settings need to be configured in the AS/400 OUTQ.
  1. First, download and install the print driver specific for your label printer. You may download many types of label printer drivers from Seagullscientific.com. Some drivers are available for a free download, and others may need to be purchased. It all depends on the printer. Add a new printer to Windows using the downloaded print driver. Assign it to the proper (COM or LPT) port. There may be a setting to download this driver to the printer when the printer is called.
  2. Now you must modify the OUTQ on the AS/400.
  • End the writer by issuing the following command: ENDWTR outq_name *IMMED. Then press ENTER. Wait for the writer to end. This should take less than 15 seconds.
  • Now, edit the OUTQ by issuing the following command: CHGOUTQ outq_name. Press F4 to prompt, do not press ENTER. Then press F24, F9 to display all parameters.
  • Page down until you find the "Host Print Transform" parameter. Verify that it is set to: *YES. If not, please change it now. Do not press ENTER yet!
  • Find the "Manufacturer type and model" parameter. Enter the following for this parameter: *WSCST.
  • Now find the "Workstation customizing object" parameter. Enter the following option: QWPDEFAULT. Do not enter an asterisk (*) before the option. Do not press ENTER yet!
  • Finally set the "Library" parameter under the "Workstation customizing object" to the following: *LIBL.
  • Now, you may press ENTER. If the "Writers to autostart" parameter is set to greater than zero, the writer for this OUTQ will start automatically. If not, you must enter the following command to start the writer: STRRMTWTR outq_name. Press ENTER.
Note that QWPDEFAULT will not be available until you have set your "Manufacturer type and model to *WSCST.
Your OUTQ should now be configured properly to print to your thermal "label" printer.

Setting up AS/400 to print to dynamic IP address

Question:
We are using DHCP and DNS or a dialup connection and would like to print data from an AS/400 to a PC. How can I configure the AS/400 so I can print to a computer with a dynamic IP address?
Answer:
One of our clients provided the following CL program. We are providing it for your consideration. As you can see, this program does the following:
  1. Prompts the user for the name of the OUTQ (printer) they want to use
  2. Automatically obtains their IP Address.
  3. Notifies the user that the OUTQ's IP address is being updated.
  4. Updates the OUTQ they provided with their IP address.
  5. Prompts them to update another OUTQ.
The CL program may be used and modified for your needs. It is possible to modify the program to eliminate all user interaction and automatically update the proper OUTQ on the AS/400. This program should be placed in the user's profile and run when the user logs in.
/* SHORT FORM DYNAMIC IP ADDRESS */
/* DIALUP CONNECTION */
/* LPD: OBTAIN IP ADDRESS OF USER AND MODIFY TCP/IP DEVICE */
/* QUEUE TO USE NEW ADDRESS (FIREWALL PRINTING) */
/* OS/400 V3.7 */
/* */
PGM
DCL / VAR(&RECEIVER) TYPE(*CHAR) LEN(892)
DCL / VAR(&DEVICE) TYPE(*CHAR) LEN(10)
DCL / VAR(&USER) TYPE(*CHAR) LEN(10)
DCL / VAR(&PRTQ) TYPE(*CHAR) LEN(10)
DCL / VAR(&CHANGE) TYPE(*CHAR) LEN(3)
DCL / VAR(&ERROR) TYPE(*CHAR) LEN(4) +
VALUE(X'00000000')
DCL / VAR(&RCVRLN) TYPE(*CHAR) LEN(4)
DCL / VAR(&FORMAT) TYPE(*CHAR) LEN(8) +
VALUE('DEVD0600')
DCL / VAR(&IPADDR) TYPE(*CHAR) LEN(15)
DCL / VAR(&DONEXT) TYPE(*CHAR) LEN(1)
DCL / VAR(&YESNO) TYPE(*CHAR) LEN(1)
DCL / VAR(&PRINTER) TYPE(*CHAR) LEN(10)
/* OBTAIN DEVICE NAME AND USERID */
RTVJOBA / JOB(&DEVICE) CURUSER(&USER)
CHGVAR / VAR(&CHANGE) VALUE(%SST(&USER 1 3))
/* NAME PRINT QUEUE TO CHANGE */
SNDUSRMSG / MSG('Enter the name of the printer to +
change!') MSGTYPE(*INQ) TOMSGQ(*) +
MSGRPY(&PRINTER)
CHGVAR / VAR(&PRTQ) VALUE(&PRINTER)
/* OBTAIN IP ADDRESS */
CHGVAR / VAR(%BIN(&RCVRLN)) VALUE(892)
CALL / PGM(QDCRDEVD) PARM(&RECEIVER &RCVRLN &FORMAT +
&DEVICE &ERROR)
CHGVAR / VAR(&IPADDR) VALUE(%SST(&RECEIVER 878 15))
/* MODIFY OUTQ WITH CURRENT IP ADDRESS */
SNDMSG / MSG('IP address is being updated, it will +
take about 15 seconds, please wait: +
<hit enter>') TOUSR(*REQUESTER) +
MSGTYPE(*INFO)
ENDWTR / WTR(&PRTQ) OPTION(*IMMED)
MONMSG / MSGID(CPF3313) /* SUPPRESS WRITER NOT STARTED MSG */
GOTO / CMDLBL(CHGOUTQ)
TRYAGAIN:
CHGVAR / VAR(&DONEXT) VALUE('a')
SNDUSRMSG / MSG('Enter the name of the printer to +
change!') MSGTYPE(*INQ) TOMSGQ(*) +
MSGRPY(&PRINTER)
CHGVAR / VAR(&PRTQ) VALUE(&PRINTER)
SNDMSG / MSG('IP address is being updated, it will +
take about 15 seconds, please wait: +
<hit enter>') TOUSR(*REQUESTER) +
MSGTYPE(*INFO)
ENDWTR / WTR(&PRTQ) OPTION(*IMMED)
MONMSG / MSGID(CPF3313) /* SUPPRESS WRITER NOT STARTED MSG */
CHGOUTQ:
DLYJOB / DLY(15) /* WAIT 15 SECONDS */
CHGOUTQ / OUTQ(QUSRSYS/&PRTQ) AUTOSTRWTR(1) +
INTNETADR(&IPADDR)
MONMSG / MSGID(CPF3319) EXEC(SNDMSG MSG('UNABLE TO +
MODIFY IP ADDRESS, WRITER IS CURRENTLY IN +
USE. (CPF3319)') TOUSR(&USER))
MONMSG / MSGID(CPF3357) EXEC(SNDUSRMSG MSG('Printer +
not found!, <R-Retry(enter PRT name), +
C-Cancel(end program)>') VALUES(R C) +
TOMSGQ(*) MSGRPY(&DONEXT))
IF / COND(&DONEXT *EQ 'C') THEN(GOTO CMDLBL(ENDPGM))
IF / COND(&DONEXT *EQ 'R') THEN(GOTO +
CMDLBL(TRYAGAIN))
ADDPRT:
SNDUSRMSG / MSG('Update another printer address? +
Yes/No(Y/N)') VALUES(Y N) MSGTYPE(*INQ) +
TOMSGQ(*) MSGRPY(&YESNO)
IF / COND(&YESNO *EQ 'N') THEN(GOTO CMDLBL(ENDPGM))
IF / COND(&YESNO *EQ 'Y') THEN(GOTO +
CMDLBL(TRYAGAIN))
ENDPGM:
ENDPGM

Verifying a connection between the AS/400 and RPM

Question:
I have configured a new OUTQ on my AS/400 to print data through RPM. For some reason, print jobs go into a SND or HLD state and do not print. No new messages appear in the RPM log file.
Is there a way to verify a connection between the AS/400 and RPM without printing a job?
Answer:
To make a TCP/IP connection to RPM, the TELNET command may be used. To verify a connection, perform the following telnet test.
  1. At the AS/400 command prompt, type TELNET and press F4
  2. In the Start TCP/IP TELNET (TELNET) screen, press F9 to view "all parameters."
  3. In the Remote System field, type *INTNETADR. Enter the IP address of the RPM host in the Internet Address field.
  4. Locate the Port parameter and enter 515, then press Enter.
If RPM is configured to relax the 'port in range' requirement, this will input-inhibit the session if a connection is made. Close RPM (Windows 9x) or restart the RPM service (RPM Elite/Select) to release the AS/400 session. Then restart RPM and check the RPM log for new message.
If RPM is not configured this way, a new message should be displayed in the RPM log stating:
Client port xxxx out of range
Although this message is a warning, it verifies that a connection was made to RPM at port 515.