Problem solve Get help with specific problems with your technologies, process and projects.

Retrieving output queue IP addresses

I need to write a CL program to obtain the IP addresses for all printers (LAN & RMTOUTQ) that we have on our system. The only OS command I can find is WRKOUTQD, but this does not allow output to *file and only one can be specified. I was wondering if there is an API I can call that does this.
There is a process that you can go through to create this information. I have an example CL available for you to use that will create an external file with all the information that you require. You will need to write an RPG program or query to retrieve the desired information. The following are the steps that you need to do in order to make the CL work properly:

1. Create a externally described physical file for use by the CL. Below are the field specifications that will be needed:


        *************** Beginning of data ** 
0001.00      A          R SPOOLTR           
0007.00      A              FILL1               1A 
0007.01      A              TEXT1          43A 
0007.02      A              OPTION       87A 
        ****************** End of data ***** 

2. Execute the following command:

DSPOBJD OBJ(QSYS/QGPL) OBJTYPE(*LIB) OUTPUT(*OUTFILE) OUTFILE(XXXX/DSPOBJ (replace the XXXX with the library that you want the information stored into.)

3. Create the following CL:

              DCLF       FILE(XXXX/DSPOBJ)                       
              CLRPFM     FILE(XXXX/SPOOLT)                       
              DSPOBJD    OBJ(*ALL/*ALL) OBJTYPE(*OUTQ) +         
                           OUTPUT(*OUTFILE) OUTFILE(GLEN/DSPOBJ) 
              RCVF       RCDFMT(QLIDOBJD)                         
              MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(END))   
                           SPLNBR(*LAST) MBROPT(*ADD)         

              GOTO       CMDLBL(START)                         
 END:         ENDPGM    

Replace the XXXX with the library name of where the object was created. Replace the HHHHHH with the name of the file that was created in step one.

4. Run the CL.

5. With the file created in step one, you can use an RPG program, iSeries query or even download the file and get all the necessary information that you need.


The Best Web Links: Tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Read this Search400.com Featured Topic: Managing your iSeries.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.

This was last published in March 2004

Dig Deeper on Performance

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Join the conversation


Send me notifications when other members comment.

Please create a username to comment.

Try compiling the CL and PF. Do not understand the need for the FIL1,TEXT1 and OPTION in the physical file?
For the remote output queue's and IP addresses, write a query over the top of cfgtcp optioon 10 which is file QATOCHOST / QUSRSYS.



  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...