[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 998
  • Last Modified:

Automatically Stop and start Print Writers via Script

I don't know if this is possible without doing some programming, but does anyone know if you can use a script  that would end all print writers and start them back on the AS400?  

I have both devices and remote outques setup in my environment, and I would need to be able to manage all of them if possible.  I would like to be able to End the writer, vary off the device(where applicable), Vary the device back on, and then start the writer.  

I don't think that you can do this without a CL program, but I wanted to be sure.  
0
mdennis4422
Asked:
mdennis4422
  • 2
  • 2
  • 2
  • +1
1 Solution
 
Gary PattersonVP Technology / Senior Consultant Commented:
If you end the QSPL subsystem, it'll end all writers - local and remote.  If you need to vary the devices off and on, you'll have to do that individually unless you have a naming convention that uniquely identifies printers.  



PGM
ENDSBS QSPL *IMMED
DLYJOB DLY(600)  /* Wait to allow subsystem to end */
VRYCFG CFGOBJ(PRT*) CFGTYPE(*DEV) STATUS(*OFF) /* If there is a naming convention */
 
or
 
VRYCFG PRINTER1 *OFF
VRYCFG PRINTER2 *ON
...
 
VRYCFG CFGOBJ(PRT*) CFGTYPE(*DEV) STATUS(*ON)
 
-or-
VRYCFG PRINTER1 *ON ...
...
 
STRSBS QSPL
ENDPGM

Open in new window

0
 
Gary PattersonVP Technology / Senior Consultant Commented:
CL is the AS/400 scripting language.  Are you looking for a way to do this from another scripting language?  If so, what scripting language?
0
 
mdennis4422Author Commented:
Actually, I am looking for whatever way is possible.  I am not a programmer, I do have some experience with Visual Basic scripts but that is limited.  If I stop the QSPL subsystem and restart it, does it restart each writer?  Can I run the above commands individually from the job scheduler?  
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
_b_hCommented:
To end all writers, use:
ENDWTR WTR(*ALL) OPTION(*IMMED)  
To start print writers, use:
STRPRTWTR DEV(*ALL)
To start remote writers, use:
STRRMTWTR OUTQ(*ALL)

My recollection is that starting QSPL will start remote writers through an autostart job entry, but print writers need to be started separately. You could add another autostart job entry, keeping in mind that is a change to an IBM object that must be documented for future upgrades.

What is the requirement for varying off and on the devices?




0
 
tliottaCommented:
mdennis4422:

Because you have both physical devices and remote output queues, your environment seems complex enough that care should be taken. Not because something will get broken, but because it might take some time determining what might have gone wrong with some unusual printer device or non-standard output queue. It can be tricky enough just trying to handle someone's iSeries Access printer emulation session when we don't know that that's what we're dealing with.

Before jumping into a fully automated end/restart scenario, how about providing a little background on what the business problem is? Why is this needed? What is it expected to provide?

Tom
0
 
mdennis4422Author Commented:
I was asked to find out how to do this from out Sr level management.  We outsource our first level help desk calls and the number one ticket producer in the mornings is printers that are not started for whatever reason.   He wanted to stop and restart all printers to try to prevent this from being the number one item on the list each month.  I told him that I would check around and see.  I did not know that you could specify an *all with the commands above.  I don't think that it is a good idea to do this, however most of the time I have to prove to him that it will cause more problems than it is worth before he will believe me.  I just wanted to get some more input before I answered his question.....
0
 
tliottaCommented:
mdennis4422:

Can you determine if the major 'problem' printers are serviced through printer device descriptions or remote *outqs? Has anybody determined a reason why the printer users aren't allowed simply to start the printers themselves?

(Purely personal preference here, but I have always approached systems as belonging to the users. Whenever I could supply them with control over their own resources, problems would start to fade. Starting/stopping/holding printers was a common capability to grant, as long as it was for their own files.)

Tom
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now