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.
Last Wiki Answer Submitted: May 12, 2008 3:43 pm by SOUTHEAST30 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
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.
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.
There is a command on the iSeries, CLRJOBQ JOBQ(*LIBL/XXXXXXXXXX) LOG(*JOB) , if you want to end all jobs.
This will only cancel jobs waiting in the queue for a subsystem not the currently running jobs.
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)
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.
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