Retrieve AS/400 Printer definition

135 pts.
Tags:
AS/400 printing
iseries v5r4
RPG Program
I would like to let my users override the printed output to a printer of their choice but I need to protect them from themselves. Is there a way that I can determine if the name they enter is a valid print device? I would like to be able to do this in an RPG program on an AS400 running V5R4.

Software/Hardware used:
AS400 V5R4

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    One possible beginning direction would be:
    DSPOBJD OBJ(*ALL) OBJTYPE(*DEVD) OUTPUT(*OUTFILE) OUTFILE(QTEMP/DEVD)
    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". Tom
    125,585 pointsBadges:
    report
  • Oldtonew
    [...] Retrieve AS/400 Printer definition http://itknowledgeexchange.techtarget.com/itanswers/retrieve-printer-definition/ [...]
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following