i have 3 or more printers in each branch of my company and each night i
send automatic reports to printer 01.
Some branches swith off printer 01 when they leave each day.
In order to send these reports to printer 02 (or 03, 04...) if 01 if
offline, I am now looking for an operating mode or a CLP to check if a
printer is alive (check the device status and its editor).
Thank You
--
Pat
I don't have the time to look up the name of it right now, but there
is an API that you can use to check if there is a writer running and
what its status is. I.e. if there is a writer, but it is in MSGW
status, you might still want to send the report to a different
printer.
--
Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.
Create a program with a list of IP addresses and maybe branch number/name and you can programatically choose which printer based on ping confirmation.
Are you using device/outq's or just remote outq's. Look at using
rtvcfgsts and the stscde parm.
On Fri, 29 Jul 2011 13:54:23 +0200, Patrick Tonnerre
<nos...@nospam.org> wrote:
>In order to send these reports to printer 02 (or 03, 04...) if 01 if
>offline, I am now looking for an operating mode or a CLP to check if a
>printer is alive (check the device status and its editor).
Follow up to my prior post:
The API for checking the status of a writer is the QSPRWTRI (Retrieve
Writer Information) API.
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/apis/QSPRWTRI.htm
You can give it the printer name and get back information about the
associated writer. You'll need to check the API error status (for
example, if there is no writer running) and if there are no errors,
check the various writer and output queue status flags to determine if
you want to use a particular printer.
Though typically a printer prints from an output queue of the same
name in QUSRSYS, that doesn't have to be true. You can get the actual
output queue name and library name from the information returned by
the API.
You shouldn't need to check the device status with this method,
however if you want to, you can.
If you are writing a CL program, you can use the RTVCFGSTS status.
If you are using some other HLL, you can use the QDCRCFGS (Retrieve
Configuration Status) API which provides the same information.
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/topic/apis/QDCRCFGS.htm
I wrote a program for several purposes a while ago.
PINGMONCL - Source posted here
http://pastebin.com/cDs3f3Tm
CALL PGM(PINGMONCL) PARM(&IPORNAME &YESNO &rspnstim)
You can utilize this program to ping by IP or hostname and get back a 'Y' or 'N' as well as the response time in milliseconds...for your case, you would only be interested in &YESNO coming back from PINGMONCL.
Create a program to search a file containing the branch and printer ip or name (if applicable) and if your response is a 'Y', send to that printer....
Good Morning,
i've already started a CLP program using that command :
WRKCFGSTS CFGTYPE(*DEV) CFGD(&PRINTERS) OUTPUT(*PRINT) +
STATUS(*ACTIVE)
Then i will copy it in a file which will be processed.
That command seems to be interesting for me because if a printer is not
started il will not appear in the list.
Completed with a ping i hope it will be useful for me.
I've never use APIs on iSeries CLP.
Maybe somebody have some examples or URL's describing their usage.
Thank You all for your help
--
Pat
Pinging the printer will confirm that you have communications (and that the printer is on)