With QTEMP/DEVD populated, you’d perhaps be interested only in the devices that satisfied this condition:

SELECT * FROM qtemp/devd WHERE ODOBAT like '%PRT%'

It’s not required to use SQL to limit the rows only to “printer” devices. A CL program could use RCVF to read each row to see if the device name matched what was requested and if that device attribute indicated that it was a form of printer device. Any HLL could do the processing.

Or you could simply run:

CHGDEVPRT DEVD( <devicename> )

If you execute CHGDEVPRT with no parms other than DEVD(), the only things that happen are verification that such a device exists and that it’s actually a printer. If either condition is false, an *ESCAPE message is returned.

There are more definite solutions if you want to use system configuration APIs. I can’t tell how far you want to go with this. Keep in mind that elements such as a user’s authority to a device or to an *OUTQ might be involved. Also, a “printer” device might not actually exist — it might only be a “remote output queue”.