Solved

Automatically Stop and start Print Writers via Script

Posted on 2008-06-09
7
884 Views
Last Modified: 2013-12-06
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
Comment
Question by:mdennis4422
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
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
 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
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
 
LVL 3

Author Comment

by:mdennis4422
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 13

Accepted Solution

by:
_b_h earned 250 total points
Comment Utility
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
 
LVL 27

Expert Comment

by:tliotta
Comment Utility
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
 
LVL 3

Author Comment

by:mdennis4422
Comment Utility
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
 
LVL 27

Expert Comment

by:tliotta
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction Often we come across situations wherein our batch files would be needing to reboot Windows for a variety of reasons. A few of them would be like: (1) Setup files have been updated whose changes can take effect only after a reboot …
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now