Question

  Asked: May 12 2008   9:06 AM GMT
  Asked by: Konik


iSeries - ending jobs in one sbs


iSeries applications, QBATCH, SBS(QBATCH), ENDSBS, -48 dc

Hi, in our application we need to end all jobs in sbs Qbatch (not the subsystem, but jobs only). Do you know how to do it?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



You can writhe a CL program that will capture the entire subsystem into a physical file and read each job in the file and capture the number, user and name. Then run a command to end that job with the prams captured.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Isjld  |   May 12 2008  3:37PM GMT

There is a command on the iSeries, CLRJOBQ JOBQ(*LIBL/XXXXXXXXXX) LOG(*JOB) , if you want to end all jobs.

 

Rodda  |   May 13 2008  1:44AM GMT

This will only cancel jobs waiting in the queue for a subsystem not the currently running jobs.

 

Rodda  |   May 13 2008  1:52AM GMT

If you want to end all jobs in the subsystem why not do:

ENDSBS SBS(QBATCH)
OPTION(*CNTRLD)
DELAY(30)

DLYJOB DLY(60) /* give enough time to end all jobs */

STRSBS SBSD(QBATCH)

 

Taekwondo  |   May 13 2008  1:41PM GMT

I have to ask. Why would you end jobs that are running? You may be creating a mess that needs cleaning up. What if you are in the middle of updating? Sounds as if you are trying to treat the system like a PC. I would look at QBATCH first to see average runtimes(assume 1 hour) then I would use a CL to put QBATCH on hold 65 minutes before I needed it shut down. Do the function you need and as a last step release the job queue. No mess worry about afterwords.