Skip to Content
avatar image
Former Member

Mass convert job status to unknown

Hi All

CPS build is M33.120-83827,

We have more than 70K+ jobs in status canceling, we need to set the status to unknown.

I'm looking for a query or script to do the conversion.

I need to use Job.Status , Job.JobDefinition and Job.Queue as the the condition in where clause.

Please provide the exact SQL query or script or any other method to get rid of changing each job status to unknown.

Help is very much appreciated

Thanks

Maddy.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Apr 17 at 09:21 AM

    Hello Maddy,

    I am not sure if you can move the cancelling status to unknown, by running the jobs - System_ForceJobStatusUnknown by providing the job id check if they are moved to unknown status.

    You the below query should work to check all jobs are in cancelling status ("c" is cancelling code)

    query = "Select a.* from Job a, JobDefinition b where a.JobDefinition = b.UniqueId and b.Name = '" + pJobName + "' and a.Status in ('c')";

    You can use the table iteration as below to perform this action, try j.unknown() to move the job to unknown status.

    for (Iterator it = jcsSession.executeObjectQuery(query, null); it.hasNext();)

    j.disable() or j.unknown()

    Regards,

    Abhishek

    Add comment
    10|10000 characters needed characters exceeded