?
Solved

AS/400 Printer IP address

Posted on 2008-11-14
11
Medium Priority
?
3,702 Views
Last Modified: 2012-05-05
I have a feeling I am not going to like the answer but I am going to ask the question anyway...

We have a mixture of printers here, for the most part, the "IP" address shows up with I do a WRKOUTQD
Every so often the network people will give away the IP that we have already assigned to an AS/400 printer.

Is there any way I can get a full listing of all of the printer IP addresses?
0
Comment
Question by:ScottParker
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 2

Expert Comment

by:felny
ID: 22959567
http://www.download25.com/install/free-ip-scanner.html

only need to get the star ip addres to final ip addres.

example 192.168.1.0 --> 192.168.1.254
0
 
LVL 27

Expert Comment

by:tliotta
ID: 22964393
ScottParker:

> ...listing of all of the printer IP addresses?

"All" the printers? Since you describe changes of printer IP addresses, it's not clear if you mean "all of the printers that are supposed to be used by our AS/400" or "all of the printers on our network that might be used someday by our AS/400".

Can you clarify? There might be many printers with IP addresses in your network that your AS/400 shouldn't print on.

Normally, this should be handled by DNS and related protocols -- don't use IP addresses; use DNS to supply the address based on the name. If a host name identifies a printer, your network people shouldn't be changing its IP address nor giving out conflicting addresses. If devices aren't identified, then your AS/400 sure shouldn't be sending simply to an IP address.

Tom
0
 
LVL 3

Author Comment

by:ScottParker
ID: 22975031

tliotta,
To clarify... A way to get all of the IP addresses that are currently listed in any OUTQ definitions.

I did not innitialy set up how OUTQ's are assigned on our iSeries... I only have to deal with it now.
And I have NO control over our "Network" department.  That is why I want to give them a list of whats currently set up.

I do not claim to know a lot about OUTQ's and devices and such... But the way I was trained was just to do a CRTOUTQ command and fill in certian fields.   One of those fields is the "IP" address.

0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 13

Accepted Solution

by:
_b_h earned 1200 total points
ID: 23032211
Here is some code that I used some time ago. It searches a library for outqs. It needs some work but may do what you need.

PGM        PARM(&LIB)
DCL  &LIB       *CHAR      10   /* LIBRARY/*ALL/*ALLUSR/*LIBL       */
/* PARMS FOR RETRIEVE OUTPUT QUEUE ATTRIBUTES API */
DCL &OQRCVR     *CHAR    1096   /*RECEIVER VARIABLE                  */
DCL &OQRCVRLEN  *CHAR       4   /*LENGTH OF RECEIVER VARIABLE        */
DCL &OQRCVRFMT  *CHAR      10   /*FORMAT NAME                        */
DCL &QUALOQ     *CHAR      20   /*QUALIFIED OUTQ NAME                */
DCL &ERRCDE     *CHAR       8   /* API ERROR CODE PARAMETER          */
/**/
DCL &RMTSYSTYPE *CHAR       1   /* REMOTE SYSTEM TYPE                */
DCL &RMTSYSNAME *CHAR      20   /* REMOTE SYSTEM NAME                */
DCL &MSG        *CHAR      60   /* MESSAGE                           */
DCL &DEVDATR    *CHAR      10   /* DEVICE DESCRIPTION ATTRIBUTE      */
DCL &COUNTOQ    *DEC     (6 0)  /* TOTAL COUNT OF OUTPUT QUEUES      */
DCL &COUNTOQC   *CHAR       6   /* TOTAL COUNT OF OUTPUT QUEUES CHAR */
DCL &COUNTROQ   *DEC     (6 0)  /* TOTAL COUNT OF REMOTE OUTQS       */
DCL &COUNTROQC  *CHAR       6   /* TOTAL COUNT OF REMOTE OUTQS  CHAR */
DCL &COUNTROQD  *DEC     (6 0)  /* COUNT OF REMOTE OUTQS WITH DEVD   */
DCL &COUNTROQDC *CHAR       6   /* COUNT OF RMTOUTQS WITH DEVD CHAR  */
/**/
DCLF       FILE(QADSPOBJ)
/**/
             DSPOBJD    OBJ(&LIB/*ALL) OBJTYPE(*OUTQ) +
                          OUTPUT(*OUTFILE) OUTFILE(QTEMP/QADSPOBJ)
             OVRDBF QADSPOBJ TOFILE(QTEMP/QADSPOBJ)
             CHGVAR  &OQRCVRLEN  X'00000448'    /* X'0448' IS 1096 OF DATA */
             CHGVAR  &OQRCVRFMT  'OUTQ0100'
             CHGVAR  &COUNTOQ    0
             CHGVAR  &COUNTROQ   0
NEXTOQ:
             RCVF
             MONMSG     MSGID(CPF0864) EXEC(DO)
             GOTO       CMDLBL(ENDOFFILE)
             ENDDO
             /*RETRIEVE THE ATTRIBUTES OF THE OUTPUT QUEUE */
             CHGVAR  &QUALOQ  (&ODOBNM  || &ODLBNM     )
             CALL QSPROUTQ (&OQRCVR &OQRCVRLEN &OQRCVRFMT &QUALOQ &ERRCDE)
             CHGVAR  &COUNTOQ   (&COUNTOQ + 1)
             CHGVAR &RMTSYSTYPE  %SST(&OQRCVR 217 1)
             /* CHECK IF OUTQ HAS A SYSTEM NAME (IP OR NAME) */
             IF (&RMTSYSTYPE *NE '0') THEN(DO)
                CHGVAR &RMTSYSNAME  %SST(&OQRCVR 218 20)
                CHGVAR &MSG ( &ODLBNM *CAT &ODOBNM *CAT &RMTSYSNAME)
                CHGVAR  &COUNTROQ   (&COUNTROQ + 1)
                /* CHECK IF A DEVICE EXISTS */
                CHGVAR  &DEVDATR   '          '
                RTVOBJD QSYS/&ODOBNM OBJTYPE(*DEVD) OBJATR(&DEVDATR)
                MONMSG (CPF9800) EXEC(DO)
                   CHGVAR  &DEVDATR   '          '
                   ENDDO
                IF (%SST(&DEVDATR 1 3) = 'PRT') THEN(DO)
                   CHGVAR  &COUNTROQD  (&COUNTROQD + 1)
                   ENDDO
                CHGVAR &MSG (&MSG *BCAT &DEVDATR)
                SNDPGMMSG &MSG
                ENDDO
             GOTO       CMDLBL(NEXTOQ)
ENDOFFILE:
             CHGVAR &COUNTOQC  &COUNTOQ
             SNDPGMMSG ('TOTAL OUTPUT QUEUES:       ' *CAT &COUNTOQC)
             CHGVAR &COUNTROQC  &COUNTROQ
             SNDPGMMSG ('TOTAL REMOTE OUTQS:        ' *CAT &COUNTROQC)
             CHGVAR &COUNTROQDC  &COUNTROQD
             SNDPGMMSG ('REMOTE OUTQS WITH DEVICES: ' *CAT &COUNTROQDC)
ENDPGM:
             ENDPGM

0
 
LVL 3

Author Comment

by:ScottParker
ID: 23037139
That is great code, and kind of what I am looking for but not quite.
It does not show the IP addresses.
The only place I can seem to find them is in the "WRKOUTQD" command.  and that does not have an option to go to a file.  only to the display or print.
0
 
LVL 27

Assisted Solution

by:tliotta
tliotta earned 800 total points
ID: 23037816
ScottParker:

Okay, then here's a proc that accepts a qualified *outq name and displays whatever is returned in the 'Remote system name' attribute. It relies on (1) Barry's code to pass in the qualified name and (2) the Retrieve Output Queue Information (QSPROUTQ) API to resolve basic attributes.

For reference:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/QSPROUTQ.htm

If compiled as a program named RTVOUTQIP, it could be called from a command line as:

 == >  call RTVOUTQIP  'ARMTOUTQ  MYLIB     '


QCLSRC.RTVOUTQIP.txt
0
 
LVL 27

Expert Comment

by:tliotta
ID: 23039602
BTW, that last code doesn't go to a 'file' either. But then, CL technically has no way to output to a 'file' except a display file.

You can print by binding printf() or other means; you could use STRQMQRY or other SQL functions to run INSERT or other statements; or you could store the data elements [outq, outq library, IP address, whatever] in a message queue or other object.

Or convert the code to COBOL or RPG or C or REXX or whatever languages you have available. Those have useful file I/O functions available.

I'll apologize and offer my only defense as not knowing what level of knowledge you posess. Your rating says 'Advanced'.

Tom
0
 
LVL 13

Expert Comment

by:_b_h
ID: 23041841
okay, i'm out
0
 
LVL 3

Author Comment

by:ScottParker
ID: 23043627
Ack..
I messed up on assigning the points.

Is there any way to redo that?
0
 
LVL 27

Expert Comment

by:tliotta
ID: 23045141
ScottParker:

Agreed on points need re-doing. Barry clearly needs a major share. Unfortunately, I don't know the procedure. I see a [Request attention] link in the opening post, lower right, though I don't know what it does. I know that Dave Slater (a Zone advisor here) can provide all info needed.

Tom
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
If anyone asked you to network diagram of the internet, it was drawn in the form of a fluffy cloud which further became known as cloud computing. Popularly cloud computing is defined as workloads that run over the internet in a commercial provider’s…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question