The job will always have the same name, but could be submitted by user QMQM, QSYSOPR or me. Normally it is QMQM. I only need to end the active jobs with that name. Our system is pretty well locked down so no one else can submit jobs to this subsystem. Most of the jobs I see are in the OUTQ status.
Main Topics
Browse All Topics





by: tliottaPosted on 2009-09-29 at 12:17:56ID: 25452337
douggnau:
This bit needs clarification:
> I have two jobs that have the same name that I want to end but I need to know the job number to do this --without intervention--.
...plus:
> These are batch jobs that could have a different user each time.
Are you asking simply to end any active job that has the given job name? Or should it only end the jobs if they have a particular user name?
A CL program can obtain a list of active jobs that have a given job name. In order to end any of them, the CL program will need to know which ones to end. It can end them all, one at a time. It can check each job and end the ones with a given user name. It can end each one based upon a variety of possible attributes.
But somewhere along the line, it will need to know how to decide which ones to end.
Keep in mind that anyone who can submit a job can assign any valid name to the job. A job might be running that has been given the same name even though it has nothing to do with the process that you're interested in.
How do you want the CL program to make its decisions?
Tom