OUTQ name from IP address

385 pts.
Tags:
AS/400
AS/400 printing
iSeries
iSeries printing
OUTQ
HI, Can anybody let me know if there is a way to find out the outq(printer) name from the ip address? i have a lot of printers attacthed to my as400 and i would like to know the name of the one for which i have the ip addrress without looking at each one. thanks
ASKED: October 2, 2008  4:01 AM
UPDATED: August 10, 2010  6:55 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Dump all your device descriptions to a spooled file.

<b>DSPDEVD DEVD(*ALL) OUTPUT(*PRINT) </b>

Once this finishes <ul>
search the report for the IP address in question</ul>

It’s not pretty but it’s faster than writing a CL.

The field your looking for is: <b>Remote location:
Name or address ……….: xxx.xxx.xxx.xxx</b>

It’s about half way down the list of details on a device.

<b>Here’s what you might want to do to make this easier going forward.</b>

When I’m managing systems with hundreds of IP printers I usually add entries to the Host table.
The host names I match up with the printer name. (Less guess work)
That way when you need to find an IP address or a device name you can go straight to the host table and find it there and then go back and update the printer when needed.

My host tables are always bare except for printers. I rely heavily on DNS servers to resolve addresses.
Be leary of an AS400 with tons of Host table entries!

Discuss This Question: 10  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Rockleadme
    if no TAATOOL?
    385 pointsBadges:
    report
  • mcl
    Don't have TAATOOLs here. Have currently about 285 printers around the country. I just set up a table with the required info. It's not like the IP addresses change often, except for office moves or maybe replaced hardware, so it is minimal maintenance. Regards Mike
    2,740 pointsBadges:
    report
  • RCOMSTOCK
    Bryan Dietz @ http://home.columbus.rr.com/jbmmdietz/iseries.html has a WRKRMTWTR tool that is free. It shows the writer and the ip address.
    25 pointsBadges:
    report
  • Rockleadme
    thanks guys!! Mike, problem is i am new to this place and i just have the ip address and want to know the name of the ouq. any way to reverse engineer to find the name from ip address? thanks
    385 pointsBadges:
    report
  • McSick
    You can obtain the Printer IP Addresses by using the DSPOBJD, DSPDEVD, and CPYSPLF commands. I wrote a COBOL program to read the spooled file to extract the Printer, Text, and IP Address and write to a physical file. ***************************** CL Program: PGM DCL VAR(&RTNLIB) TYPE(*CHAR) LEN(10) DCLF FILE(TEMPDEVDPF) RTVOBJD OBJ(TEMPPRTIPS) OBJTYPE(*FILE) RTNLIB(&RTNLIB) CLRPFM FILE(&RTNLIB/TEMPPRTIPS) DLTF FILE(QTEMP/TEMPDEVDPF) MONMSG MSGID(CPF0000) RTVOBJD OBJ(TEMPDEVDPF) OBJTYPE(*FILE) RTNLIB(&RTNLIB) CRTDUPOBJ OBJ(TEMPDEVDPF) FROMLIB(&RTNLIB) + OBJTYPE(*FILE) TOLIB(QTEMP) MONMSG MSGID(CPF0000) DLTF FILE(QTEMP/TEMPDEVDSP) MONMSG MSGID(CPF0000) RTVOBJD OBJ(TEMPDEVDSP) OBJTYPE(*FILE) RTNLIB(&RTNLIB) CRTDUPOBJ OBJ(TEMPDEVDSP) FROMLIB(&RTNLIB) + OBJTYPE(*FILE) TOLIB(QTEMP) MONMSG MSGID(CPF0000) DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*DEVD) + OUTPUT(*OUTFILE) OUTFILE(QTEMP/TEMPDEVDPF) RCVF: RCVF MONMSG MSGID(CPF0864) EXEC(DO) GOTO CMDLBL(ENDPGM) ENDDO IF COND(&ODOBAT = 'PRTLAN') THEN(DO) DSPDEVD DEVD(&ODOBNM) OUTPUT(*PRINT) OPTION(*BASIC) CPYSPLF FILE(QPDCDEV) TOFILE(QTEMP/TEMPDEVDSP) + SPLNBR(*LAST) CALL PGM(CRTPRTIPCB) DLTSPLF FILE(QPDCDEV) SPLNBR(*LAST) ENDDO GOTO CMDLBL(RCVF) ENDPGM: ENDPGM *************************************** Cobol CBLLE Program: IDENTIFICATION DIVISION. PROGRAM-ID. CRTPRTIPCB. ***************************************************************** * Create Printer IP Address File (TEMPPRTIPS) ***************************************************************** ENVIRONMENT DIVISION. CONFIGURATION SECTION. SOURCE-COMPUTER. AS-400. OBJECT-COMPUTER. AS-400. SPECIAL-NAMES. DATA-AREA IS DATAAREA. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT SPL-MASTER ASSIGN DATABASE-TEMPDEVDSP ORGANIZATION SEQUENTIAL FILE STATUS SPL-STATUS. SELECT IPS-MASTER ASSIGN DATABASE-TEMPPRTIPS ORGANIZATION INDEXED ACCESS DYNAMIC RECORD KEY EXTERNALLY-DESCRIBED-KEY FILE STATUS IPS-STATUS. DATA DIVISION. FILE SECTION. FD SPL-MASTER. 01 SPL-REC. COPY DDS-ALL-FORMATS OF TEMPDEVDSP. FD IPS-MASTER. 01 IPS-REC. COPY DDS-ALL-FORMATS OF TEMPPRTIPS. WORKING-STORAGE SECTION. 01 WS-FILE-STATUS. 05 SPL-STATUS PIC X(02). 05 IPS-STATUS PIC X(02). 01 SPL-EOF-SW PIC X(01). 01 IPS-INV-SW PIC X(01). PROCEDURE DIVISION. 000-INPUT SECTION. 000-MAIN-PARA. OPEN INPUT SPL-MASTER I-O IPS-MASTER. MOVE '0' TO SPL-EOF-SW PERFORM 600-READ-SPL-MASTER-NEXT PERFORM 100-PROCESS-SPL-MASTER UNTIL SPL-EOF-SW = '1' CLOSE SPL-MASTER IPS-MASTER. GOBACK. 100-PROCESS-SPL-MASTER. IF TDSKEYWD = 'DEVD' MOVE TDSDATA TO TPIPRTF PERFORM 600-READ-IPS-MASTER END-IF. IF TDSDESC (1:18) = ' Name or address' MOVE TDSDATA TO TPIIP END-IF. IF TDSDESC (1:5) = ' Text' MOVE TDSDATA TO TPITEXT PERFORM 600-WRITE-IPS-MASTER END-IF. PERFORM 600-READ-SPL-MASTER-NEXT. 600-READ-SPL-MASTER-NEXT. READ SPL-MASTER NEXT AT END MOVE '1' TO SPL-EOF-SW END-READ. 600-READ-IPS-MASTER. MOVE '0' TO IPS-INV-SW READ IPS-MASTER INVALID KEY MOVE '1' TO IPS-INV-SW END-READ. 600-WRITE-IPS-MASTER. IF IPS-INV-SW = '1' MOVE '0' TO IPS-INV-SW WRITE IPS-REC INVALID KEY MOVE '1' TO IPS-INV-SW END-WRITE ELSE MOVE '0' TO IPS-INV-SW REWRITE IPS-REC INVALID KEY MOVE '1' TO IPS-INV-SW END-REWRITE END-IF. ************************** DDS Source for TEMPDEVDSP: A***************************************************************** A* CpySplf QPDCDEV from DspDevD for PrtF IP Address A***************************************************************** A R TEMPDEVDSR A TDSDESC 40A COLHDG('Description') A TDSKEYWD 12A COLHDG('Keyword') A TDSDATA 80A COLHDG('Data') ************************** DDS Source for TEMPPRTIPS (Keyed by Printer) A***************************************************************** A* Printer IP Addresses A***************************************************************** A UNIQUE A R TEMPPRTIPR TEXT('Printer IP Addresses' A TPIPRTF 10A COLHDG('Print File') A TPITEXT 30A COLHDG('Text') A TPIIP 30A COLHDG('IP Address') A K TPIPRTF DDS Source for TEMPPRTIP1 (Keyed by IP): A***************************************************************** A* Printer IP Addresses by IP A***************************************************************** A R TEMPPRTIPR PFILE(TEMPPRTIPS) A K TPIIP
    30 pointsBadges:
    report
  • McSick
    You can obtain the Printer IP Addresses by using the DSPOBJD, DSPDEVD, and CPYSPLF commands.
    I wrote a COBOL program to read the spooled file to extract the Printer, Text, and IP Address and write to a physical file.
    
    *****************************
    CL Program:
                 PGM
    
                 DCL        VAR(&RTNLIB) TYPE(*CHAR) LEN(10)
                 DCLF       FILE(TEMPDEVDPF)
    
    
                 RTVOBJD    OBJ(TEMPPRTIPS) OBJTYPE(*FILE) RTNLIB(&RTNLIB)
                 CLRPFM     FILE(&RTNLIB/TEMPPRTIPS)        
    
                 DLTF       FILE(QTEMP/TEMPDEVDPF)
                 MONMSG     MSGID(CPF0000)
                 RTVOBJD    OBJ(TEMPDEVDPF) OBJTYPE(*FILE) RTNLIB(&RTNLIB)
                 CRTDUPOBJ  OBJ(TEMPDEVDPF) FROMLIB(&RTNLIB) +
                            OBJTYPE(*FILE) TOLIB(QTEMP)
                 MONMSG     MSGID(CPF0000)
    
                 DLTF       FILE(QTEMP/TEMPDEVDSP)
                 MONMSG     MSGID(CPF0000)
                 RTVOBJD    OBJ(TEMPDEVDSP) OBJTYPE(*FILE) RTNLIB(&RTNLIB)
                 CRTDUPOBJ  OBJ(TEMPDEVDSP) FROMLIB(&RTNLIB) +
                            OBJTYPE(*FILE) TOLIB(QTEMP)
                 MONMSG     MSGID(CPF0000)
    
                 DSPOBJD    OBJ(*ALL/*ALL) OBJTYPE(*DEVD) +
                              OUTPUT(*OUTFILE) OUTFILE(QTEMP/TEMPDEVDPF)
     RCVF:
                 RCVF
                 MONMSG     MSGID(CPF0864) EXEC(DO)
                  GOTO       CMDLBL(ENDPGM)
                 ENDDO
    
                 IF         COND(&ODOBAT = 'PRTLAN') THEN(DO)
                   DSPDEVD    DEVD(&ODOBNM) OUTPUT(*PRINT) OPTION(*BASIC)
                   CPYSPLF    FILE(QPDCDEV) TOFILE(QTEMP/TEMPDEVDSP) +
                              SPLNBR(*LAST)
                   CALL       PGM(CRTPRTIPCB)
                   DLTSPLF    FILE(QPDCDEV) SPLNBR(*LAST)
                 ENDDO
                 GOTO       CMDLBL(RCVF)
    
     ENDPGM:
                 ENDPGM
    ***************************************
    Cobol CBLLE Program:
           IDENTIFICATION   DIVISION.
           PROGRAM-ID.      CRTPRTIPCB.
          *****************************************************************
          * Create Printer IP Address File (TEMPPRTIPS)
          *****************************************************************
           ENVIRONMENT       DIVISION.
           CONFIGURATION     SECTION.
           SOURCE-COMPUTER.  AS-400.
           OBJECT-COMPUTER.  AS-400.
           SPECIAL-NAMES.    DATA-AREA IS DATAAREA.
           INPUT-OUTPUT      SECTION.
           FILE-CONTROL.
    
               SELECT SPL-MASTER  ASSIGN DATABASE-TEMPDEVDSP
                                  ORGANIZATION SEQUENTIAL
                                  FILE STATUS SPL-STATUS.
    
               SELECT IPS-MASTER  ASSIGN DATABASE-TEMPPRTIPS
                                  ORGANIZATION INDEXED
                                  ACCESS DYNAMIC
                                  RECORD KEY EXTERNALLY-DESCRIBED-KEY
                                  FILE STATUS IPS-STATUS.
    
           DATA DIVISION.
           FILE SECTION.
           FD  SPL-MASTER.
           01  SPL-REC.
               COPY DDS-ALL-FORMATS OF TEMPDEVDSP.
    
           FD  IPS-MASTER.
           01  IPS-REC.
               COPY DDS-ALL-FORMATS OF TEMPPRTIPS.
    
           WORKING-STORAGE SECTION.
           01  WS-FILE-STATUS.
               05  SPL-STATUS        PIC  X(02).
               05  IPS-STATUS        PIC  X(02).
    
           01  SPL-EOF-SW PIC X(01).
           01  IPS-INV-SW PIC X(01).
    
           PROCEDURE DIVISION.
           000-INPUT SECTION.
           000-MAIN-PARA.
               OPEN INPUT SPL-MASTER
                    I-O   IPS-MASTER.
    
               MOVE '0' TO SPL-EOF-SW
               PERFORM 600-READ-SPL-MASTER-NEXT
               PERFORM 100-PROCESS-SPL-MASTER
                 UNTIL SPL-EOF-SW = '1'
    
               CLOSE SPL-MASTER
                     IPS-MASTER.
    
               GOBACK.
    
           100-PROCESS-SPL-MASTER.
               IF TDSKEYWD = 'DEVD'
                 MOVE TDSDATA TO TPIPRTF
                 PERFORM 600-READ-IPS-MASTER
               END-IF.
               IF TDSDESC (1:18) = '   Name or address'
                 MOVE TDSDATA TO TPIIP
               END-IF.
               IF TDSDESC (1:5) = ' Text'
                 MOVE TDSDATA TO TPITEXT
                 PERFORM 600-WRITE-IPS-MASTER
               END-IF.
    
               PERFORM 600-READ-SPL-MASTER-NEXT.
    
           600-READ-SPL-MASTER-NEXT.
               READ SPL-MASTER NEXT
                 AT END
                   MOVE '1' TO SPL-EOF-SW
               END-READ.
    
           600-READ-IPS-MASTER.
               MOVE '0' TO IPS-INV-SW
               READ IPS-MASTER
                 INVALID KEY
                   MOVE '1' TO IPS-INV-SW
               END-READ.
    
           600-WRITE-IPS-MASTER.
               IF IPS-INV-SW = '1'
                 MOVE '0' TO IPS-INV-SW
                 WRITE IPS-REC
                   INVALID KEY
                     MOVE '1' TO IPS-INV-SW
                 END-WRITE
               ELSE
                 MOVE '0' TO IPS-INV-SW
                 REWRITE IPS-REC
                   INVALID KEY
                     MOVE '1' TO IPS-INV-SW
                 END-REWRITE
               END-IF.
    **************************
    DDS Source for TEMPDEVDSP:
    
         A*****************************************************************
         A* CpySplf QPDCDEV from DspDevD for PrtF IP Address
         A*****************************************************************
         A          R TEMPDEVDSR
         A            TDSDESC       40A         COLHDG('Description')
         A            TDSKEYWD      12A         COLHDG('Keyword')
         A            TDSDATA       80A         COLHDG('Data')
    **************************
    DDS Source for TEMPPRTIPS (Keyed by Printer)
         A*****************************************************************
         A* Printer IP Addresses
         A*****************************************************************
         A                                      UNIQUE
         A          R TEMPPRTIPR                TEXT('Printer IP Addresses'
         A            TPIPRTF       10A         COLHDG('Print File')
         A            TPITEXT       30A         COLHDG('Text')
         A            TPIIP         30A         COLHDG('IP Address')
         A          K TPIPRTF
    
    DDS Source for TEMPPRTIP1 (Keyed by IP):
         A*****************************************************************
         A* Printer IP Addresses by IP
         A*****************************************************************
         A          R TEMPPRTIPR                PFILE(TEMPPRTIPS)
         A          K TPIIP
    
    30 pointsBadges:
    report
  • mcl
    You can get the information with less code - and if you don't have a lot of (hundreds) or printers that may be what you want.. And you can refine this however you want. Do this first on a command line. (Substitute a libraro fo your choice for "yourlib") 1. CRTSRCPF FILE(yourlib/PRINTERS) 2. DSPOBJD OBJ(*ALL) OBJTYPE(*DEVD) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/DEVICES) That will give you a file with a list of all the devices on the system. Then run this CL.
                 PGM                                                       
                                                                           
                 DCLF       FILE(QTEMP/DEVICES) /* list of devices */      
                                                                           
     LOOP:                                                                 
                 RCVF                                                      
                 MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(DONE))         
                                                                           
                 IF         COND(&ODOBAT *EQ 'PRTLAN') THEN(DO)            
                 RTVCFGSRC  CFGD(&ODOBNM) CFGTYPE(*DEVD) +                 
                              SRCFILE(yourlib/PRINTERS) RTVOPT(*OBJ) +     
                              MBROPT(*ADD)                                 
                 ENDDO                                                     
                                                                           
                 GOTO       CMDLBL(LOOP)                                   
    
     DONE:               
                 ENDPGM 
    
    What you wind up with is a source file with all the configuration for each printer in a source member. You can parse the source members as needed to extract whatever you want. Regards Mike
    2,740 pointsBadges:
    report
  • Rockleadme
    thanks guys!!! appreciate the help!!! Mcl i tried what you suggested and i got the device description but i dont see no ip address in there :-( what i see is - LANATTACH(*IP) i am trying to find the name of a device by its ip address.
    385 pointsBadges:
    report
  • mcl
    Well, if you got that then you are on the right track.. LANATTACH(*IP) tells you the connection uses an internet protocol. What you are looking for is the remote location name - which could be an IP address or it could be and name which is resolved through a DNS lookup. For example, one by IP address could be - RMTLOCNAME('192.168.1.12') Regards Mike
    2,740 pointsBadges:
    report
  • TomLiotta
    You probably should run RTVCFGSRC for your *DEVDs on a daily or weekly basis. Then, you can simply search the resulting source member for the IP address or host name at any time. Also note that there quite possibly won't be any device -- it might simply be a remote *OUTQ. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following