AS400
5 pts.
0
Q:
AS400
how do you make a query of all the listed printers and display terminals in the system with the following columns: Device Type, Device Name, Description, Status, Last Used.
ASKED: Jan 21 2009  5:03 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
23625 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
I'm having trouble finding an easy way to do what you want.
1. Get a list of devices DSPOBJD OBJ(*ALL) OBJTYPE(*DEVD) can be output to a datafile
2. A CL program loops through all the devices
2.1. if the device is a printer or a terminal
2.1.1 for printer devices the RTVDEVPRT might provide the data - except for the status
2.1.1 pass data to an rpg program to write to a file
2.1.2 for displays RTVDEVDSP might provide the data - except for the status
2.1.1 pass data to an rpg program to write to a file
I'm not sure where to get the status from but if you want to pursue this we'll track it donw
3. run a query

Hi,

You can use RTVCFGSTS to get the current status of a device.

Regards,

Martin Gilbert.
Last Answered: Jan 27 2009  11:58 AM GMT by Gilly400   23625 pts.
Latest Contributors: Philpl1jb   24570 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Teandy   3250 pts.  |   Jan 22 2009  2:43PM GMT

The list objects API (QUSLOBJ) should give you what you need. Check it out at <a href="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/quslobj.htm" title="http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/quslobj.htm" target="_blank">http://publib.boulder.ibm.com/infocenter…</a>

 
0