5 pts.
 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.

Software/Hardware used:
ASKED: January 21, 2009  5:03 PM
UPDATED: January 27, 2009  11:58 AM

Answer Wiki:
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 Wiki Answer Submitted:  January 27, 2009  11:58 am  by  philpl1jb   44,070 pts.
All Answer Wiki Contributors:  philpl1jb   44,070 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

The list objects API (QUSLOBJ) should give you what you need. Check it out at http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/quslobj.htm

 5,830 pts.