Hello, I need to retrieve all the printers defined in our ISeries partition and show them so the user can select a printer. We have a program where the user can define a printer for a given report. They can go in and tell us if the report is going to Optio (and therefore needs a network printer name), or is defined via DDS (so it needs the ISeries printer name). The problem is that the users don't know the printer names - heck WE don't know all the printer names! Anyway, I've found an example here at Code400 that lists the objects - and that's a wonderful start.
What I think I'd like to do is use the QGYRPRTA API because it seems that it would tell me if the writer is started, if it's held, device status,if it's already printing, etc. Doing that will let me "weed out" some of the old printers that no one has ever removed from the system.
Everything I've learned about API's has come from what I've read online. One great example from Tom Liotta helped me create a process that allows our operators to end everyone's interactive job with one keystroke (they were going through WRKACTJOB and ending jobs one at a time- thank you, Mr. Liotta!!!) I haven't found an example of this API, and I'm not sure I understand it. The required parameter group for the QUSLOBJ API includes user space. QGYRPRTA doesn't. It does have "Receiver Variable" but I'm not sure that's the same thing.
I guess I just don't know how to start. I'd really appreciate it if someone could give me a push in the right direction on setting up the PR.
This is what I have right now, and am going to play with it starting with the sample I found of QUSLOBJ.
**-- Retrieve printer attributes---------------------
d $ListPrinters Pr ExtPgm( 'QGYRPRTA' )
d userspace 396a Const
d Length 4b 0 Const
d Formatname 8 Const
d DeviceName 10 Const
d ErrorCode 32767a Options( *VarSize )
I guess I'm a little afraid I'm going to break something!!
Thank you in advance for any advice you have.
What I think I'd like to do is use the QGYRPRTA API because it seems that it would tell me if the writer is started, if it's held, device status,if it's already printing, etc. Doing that will let me "weed out" some of the old printers that no one has ever removed from the system.
Everything I've learned about API's has come from what I've read online. One great example from Tom Liotta helped me create a process that allows our operators to end everyone's interactive job with one keystroke (they were going through WRKACTJOB and ending jobs one at a time- thank you, Mr. Liotta!!!) I haven't found an example of this API, and I'm not sure I understand it. The required parameter group for the QUSLOBJ API includes user space. QGYRPRTA doesn't. It does have "Receiver Variable" but I'm not sure that's the same thing.
I guess I just don't know how to start. I'd really appreciate it if someone could give me a push in the right direction on setting up the PR.
This is what I have right now, and am going to play with it starting with the sample I found of QUSLOBJ.
**-- Retrieve printer attributes---------------------
d $ListPrinters Pr ExtPgm( 'QGYRPRTA' )
d userspace 396a Const
d Length 4b 0 Const
d Formatname 8 Const
d DeviceName 10 Const
d ErrorCode 32767a Options( *VarSize )
I guess I'm a little afraid I'm going to break something!!
Thank you in advance for any advice you have.
Comment