iSeries – ending jobs in one sbs

5 pts.
Tags:
ENDSBS
iSeries applications
QBATCH
SBS
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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Isjld
    There is a command on the iSeries, CLRJOBQ JOBQ(*LIBL/XXXXXXXXXX) LOG(*JOB) , if you want to end all jobs.
    35 pointsBadges:
    report
  • Rodda
    This will only cancel jobs waiting in the queue for a subsystem not the currently running jobs.
    50 pointsBadges:
    report
  • Rodda
    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)
    50 pointsBadges:
    report
  • taekwondo
    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.
    90 pointsBadges:
    report
  • TomLiotta
    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 */ The problem there is the case where a job is in an error state such that it cannot end. Once you issue ENDSBS, it can't be undone. The subsystem can't be restarted since it hasn't ended yet. And the subsystem can't be used because no new jobs will start in a subsystem that is in the process of ending. It runs the risk of having an unusable subsystem until the entire system is IPLed. Much better simply to hold job queues feeding the subsystem, list jobs running in the subsystem and end those jobs. If any problems arise, you can continue without significant concern for any job that is locked up. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following