jcs.reschedule

!ONSITEY!PL/SQL API jcs.reschedule

Summary

Edit, kill, abort or restart the job.

The actions that are possible are dependent on the current status of the job.

  • If the job is already finished, you can only restart the job.
  • If the job is running, you can only kill the job.
  • If the job has not run yet, you can change its parameters (both normal and scheduling), or abort it.

The function returns the job ID: if the returned job ID differs from the original one, the job has been restarted or resubmitted.

When a job is part of a recurrence and the recurrence pattern is set to NULL, the job is removed from the recurrence group and henceon treated as an individual job. You can edit any other schedule parameter while leaving the job in the recurrence group by setting recurrence_data to jcs.def_str. When you reset recurrence_data to some (other) value, the whole recurrence group will be modified. You cannot set submit_frame_name and recurrence_data at the same time.

To edit a job, you must call the following three routines in sequence:

  1. jcs.clear_parameters(job_id);
  2. jcs.parameter(object_name, parameter_name, value); ...
  3. jcs.reschedule(job_id);

The object_name must be in the format "<owner>"."<name>", since that is what the jcs.clear_parameters(job_id) initializes the submit buffer to.

Killing a job using jcs.reschedule


       jcs.reschedule(123,'K'); -- Kill running job 123

Rescheduling a job using jcs.reschedule


       jcs.reschedule(123, starttime=>systimestamp + interval '7' day); -- reschedule for next week

Rescheduling a previously submitted job using jcs.reschedule


       begin
         host('echo hello world', starttime=>systimestamp + interval '7' days);
         commit;
         declare
           jobid number := jcs.last_job_id;
         begin
           jcs.clear_parameters(jobid);
           jcs.parameter('"SYSJCS"."HOST"', 'CMD', 'ls -l');
           jcs.reschedule(jobid, starttime=>systimestamp);
           jcs_output.put_line('Edited and rescheduled ' || jobid);
         end;
       end;

Specification

procedure reschedule(job_id in number,
statuscode in varchar2 default const.def_str,
queue_name in varchar2 default const.def_str,
starttime in varchar2,
time_window_name in varchar2 default const.def_str,
submit_frame_name in varchar2 default const.def_str,
priority in number default const.def_num,
recurrence_data in varchar2 default const.def_str,
start_at_step in varchar2 default const.def_str,
queue_partition in varchar2 default null,
time_window_partition in varchar2 default null,
submit_frame_partition in varchar2 default null,
os_user in varchar2 default const.def_str,
status_on_submit in varchar2 default const.def_str,
repeat_with_parent in varchar2 default const.def_str)

Reschedules the job.

Parameters

  • job_id - The ID of the job
  • statuscode - The new job status
  • queue_name - The name of the Queue where the job should be run in
  • starttime - The new job start date and time
  • time_window_name - The new Time Window during which the job should start
  • submit_frame_name - The new Submit Frame for repeating the job
  • priority - Priority 1-100, higher has precedence; only has relevance if the resources or Queue size is limited
  • recurrence_data - The recurrence data for the job
  • start_at_step - start at a specific Step in a Chain
  • queue_partition - the name of the Queue that the job should run in If it is not filled in the default Partition is assumed
  • time_window_partition - the Partition of the Time Window that the job should start in If it is not filled in the default Partition is assumed
  • submit_frame_partition - the Partition of the Submit Frame that decides how to repeat the job If it is not filled in the default Partition is assumed
  • os_user - the name of the OS user under which the job should run
  • status_on_submit - which status should the job have when its Step can start running (only for Chain calls)
  • repeat_with_parent - should the destination be repeated when the parent is repeated (only for destination jobs)

Transaction keyword

The transaction keyword defines how and/or when the changes are committed to the database. A definition of the various transaction keywords can be found on the jcs package summary page.

blockscommitsdatabase_modifiedautonomous

Specification

function reschedule(job_id in number,
statuscode in varchar2 default const.def_str,
queue_name in varchar2 default const.def_str,
starttime in varchar2,
time_window_name in varchar2 default const.def_str,
submit_frame_name in varchar2 default const.def_str,
priority in number default const.def_num,
info in varchar2 default const.jcs_no,
recurrence_data in varchar2 default const.def_str,
start_at_step in varchar2 default const.def_str,
queue_partition in varchar2 default null,
time_window_partition in varchar2 default null,
submit_frame_partition in varchar2 default null,
os_user in varchar2 default const.def_str,
status_on_submit in varchar2 default const.def_str,
repeat_with_parent in varchar2 default const.def_str)
    return number

Reschedules the job and returns the new job ID.

Parameters

  • job_id - The ID of the job
  • statuscode - The new job status
  • queue_name - The name of the Queue where the job should be run in
  • starttime - The new job start date and time
  • time_window_name - The new Time Window during which the job should start
  • submit_frame_name - The new Submit Frame for repeating the job
  • priority - Priority 1-100, higher has precedence; only has relevance if the resources or Queue size is limited
  • info - Y = just perform reschedule/edit checking, N = normal
  • recurrence_data - The recurrence data for the job
  • start_at_step - start at a specific Step in a Chain
  • queue_partition - the name of the Queue that the job should run in If it is not filled in the default Partition is assumed
  • time_window_partition - the Partition of the Time Window that the job should start in If it is not filled in the default Partition is assumed
  • submit_frame_partition - the Partition of the Submit Frame that decides how to repeat the job If it is not filled in the default Partition is assumed
  • os_user - the name of the OS user under which the job should run
  • status_on_submit - which status should the job have when its Step can start running (only for Chain calls)
  • repeat_with_parent - should the destination be repeated when the parent is repeated (only for destination jobs)
  • returns number - new job ID

Specification

procedure reschedule(job_id in number,
statuscode in varchar2 default const.def_str,
queue_name in varchar2 default const.def_str,
starttime in date,
time_window_name in varchar2 default const.def_str,
submit_frame_name in varchar2 default const.def_str,
priority in number default const.def_num,
recurrence_data in varchar2 default const.def_str,
start_at_step in varchar2 default const.def_str,
queue_partition in varchar2 default null,
time_window_partition in varchar2 default null,
submit_frame_partition in varchar2 default null,
os_user in varchar2 default const.def_str,
status_on_submit in varchar2 default const.def_str,
repeat_with_parent in varchar2 default const.def_str)

Reschedules the job

Parameters

  • job_id - The ID of the job
  • statuscode - The new job status
  • queue_name - The name of the Queue where the job should be run in
  • starttime - The new job start date and time
  • time_window_name - The new Time Window during which the job should start
  • submit_frame_name - The new Submit Frame for repeating the job
  • priority - Priority 1-100, higher has precedence; only has relevance if the resources or Queue size is limited
  • recurrence_data - The recurrence data for the job
  • start_at_step - start at a specific Step in a Chain
  • queue_partition - the name of the Queue that the job should run in If it is not filled in the default Partition is assumed
  • time_window_partition - the Partition of the Time Window that the job should start in If it is not filled in the default Partition is assumed
  • submit_frame_partition - the Partition of the Submit Frame that decides how to repeat the job If it is not filled in the default Partition is assumed
  • os_user - the name of the OS user under which the job should run
  • status_on_submit - which status should the job have when its Step can start running (only for Chain calls)
  • repeat_with_parent - should the destination be repeated when the parent is repeated (only for destination jobs)

Specification

function reschedule(job_id in number,
statuscode in varchar2 default const.def_str,
queue_name in varchar2 default const.def_str,
starttime in date,
time_window_name in varchar2 default const.def_str,
submit_frame_name in varchar2 default const.def_str,
priority in number default const.def_num,
info in varchar2 default const.jcs_no,
recurrence_data in varchar2 default const.def_str,
start_at_step in varchar2 default const.def_str,
queue_partition in varchar2 default null,
time_window_partition in varchar2 default null,
submit_frame_partition in varchar2 default null,
os_user in varchar2 default const.def_str,
status_on_submit in varchar2 default const.def_str,
repeat_with_parent in varchar2 default const.def_str)
    return number

Reschedules the job and returns the new job ID.

Parameters

  • job_id - The ID of the job
  • statuscode - The new job status
  • queue_name - The name of the Queue where the job should be run in
  • starttime - The new job start date and time
  • time_window_name - The new Time Window during which the job should start
  • submit_frame_name - The new Submit Frame for repeating the job
  • priority - Priority 1-100, higher has precedence; only has relevance if the resources or Queue size is limited
  • info - Y = just perform reschedule/edit checking, N = normal
  • recurrence_data - The recurrence data for the job
  • start_at_step - start at a specific Step in a Chain
  • queue_partition - the name of the Queue that the job should run in If it is not filled in the default Partition is assumed
  • time_window_partition - the Partition of the Time Window that the job should start in If it is not filled in the default Partition is assumed
  • submit_frame_partition - the Partition of the Submit Frame that decides how to repeat the job If it is not filled in the default Partition is assumed
  • os_user - the name of the OS user under which the job should run
  • status_on_submit - which status should the job have when its Step can start running (only for Chain calls)
  • repeat_with_parent - should the destination be repeated when the parent is repeated (only for destination jobs)
  • returns number - new job ID

Specification

procedure reschedule(job_id in number,
statuscode in varchar2 default const.def_str,
queue_name in varchar2 default const.def_str,
starttime in timestamp with time zone default const.def_tstamp,
time_window_name in varchar2 default const.def_str,
submit_frame_name in varchar2 default const.def_str,
priority in number default const.def_num,
recurrence_data in varchar2 default const.def_str,
start_at_step in varchar2 default const.def_str,
queue_partition in varchar2 default null,
time_window_partition in varchar2 default null,
submit_frame_partition in varchar2 default null,
os_user in varchar2 default const.def_str,
status_on_submit in varchar2 default const.def_str,
repeat_with_parent in varchar2 default const.def_str,
original_requesttime in timestamp with time zone default const.def_tstamp)

Reschedules the job

Parameters

  • job_id - The ID of the job
  • statuscode - The new job status
  • queue_name - The name of the Queue where the job should be run in
  • starttime - The new job start date and time
  • time_window_name - The new Time Window during which the job should start
  • submit_frame_name - The new Submit Frame for repeating the job
  • priority - Priority 1-100, higher has precedence; only has relevance if the resources or Queue size is limited
  • recurrence_data - The recurrence data for the job
  • start_at_step - start at a specific Step in a Chain
  • queue_partition - the name of the Queue that the job should run in If it is not filled in the default Partition is assumed
  • time_window_partition - the Partition of the Time Window that the job should start in If it is not filled in the default Partition is assumed
  • submit_frame_partition - the Partition of the Submit Frame that decides how to repeat the job If it is not filled in the default Partition is assumed
  • os_user - the name of the OS user under which the job should run
  • status_on_submit - which status should the job have when its Step can start running (only for Chain calls)
  • repeat_with_parent - should the destination be repeated when the parent is repeated (only for destination jobs)
  • original_requesttime - allows you to change a job's original request time

Specification

function reschedule(job_id in number,
statuscode in varchar2 default const.def_str,
queue_name in varchar2 default const.def_str,
starttime in timestamp with time zone default const.def_tstamp,
time_window_name in varchar2 default const.def_str,
submit_frame_name in varchar2 default const.def_str,
priority in number default const.def_num,
info in varchar2 default const.jcs_no,
recurrence_data in varchar2 default const.def_str,
start_at_step in varchar2 default const.def_str,
queue_partition in varchar2 default null,
time_window_partition in varchar2 default null,
submit_frame_partition in varchar2 default null,
os_user in varchar2 default const.def_str,
status_on_submit in varchar2 default const.def_str,
repeat_with_parent in varchar2 default const.def_str,
original_requesttime in timestamp with time zone default const.def_tstamp)
    return number

Reschedules the job and returns the new job ID.

Parameters

  • job_id - The ID of the job
  • statuscode - The new job status
  • queue_name - The name of the Queue where the job should be run in
  • starttime - The new job start date and time
  • time_window_name - The new Time Window during which the job should start
  • submit_frame_name - The new Submit Frame for repeating the job
  • priority - Priority 1-100, higher has precedence; only has relevance if the resources or Queue size is limited
  • info - Y = just perform reschedule/edit checking, N = normal
  • recurrence_data - The recurrence data for the job
  • start_at_step - start at a specific Step in a Chain
  • queue_partition - the name of the Queue that the job should run in If it is not filled in the default Partition is assumed
  • time_window_partition - the Partition of the Time Window that the job should start in If it is not filled in the default Partition is assumed
  • submit_frame_partition - the Partition of the Submit Frame that decides how to repeat the job If it is not filled in the default Partition is assumed
  • os_user - the name of the OS user under which the job should run
  • status_on_submit - which status should the job have when its Step can start running (only for Chain calls)
  • repeat_with_parent - should the destination be repeated when the parent is repeated (only for destination jobs)
  • original_requesttime - allows you to change a job's original request time
  • returns number - new job ID

See Also

plsqlTopic

onsiteTopic