Events

Events (previously, Conditions) create dependencies between jobs, which enables a successor job to execute after a predecessor job completes execution. After a predecessor job completes execution, an event is added in Control-M that enables any eligible jobs waiting for this event to run. The event is a prerequisiteClosedThe part of the job definition that controls the flow of your jobs, such as an event that controls sequence or a resource that controls load required for a successor job to execute. However, a job cannot execute until all scheduling criteria and resource requirements are met.

The following image shows events between jobs:

A global event is used to connect a job on one server with a job on another server. The event is defined with a prefix that is created in Global Conditions Prefixes, and this is then applied automatically when you create an event between folders/jobs in the Planning domain.

In the Events Tool, you can monitor all the active events in your workflow, or filter specific information about an event, such as the date of an event. You can manually add an event, such as when a job depends on an event that is not added automatically.

If your database is down and you want to stop all the jobs in your workflow from accessing the database and executing, you can manually add an event to stop the jobs from accessing the database until the database is up and the jobs can continue executing.

The following video describes Control-M Events:

Creating an Event

This procedure describes how to create an event as a dependency between jobs, which enables the successor job to execute after the predecessor job has completed execution.

Begin

  1. Hover over the predecessor job.

    A triangle appears below the rectangle of the job.

  2. Click and drag the triangle to the successor job.

    The event appears between the two jobs. You can view the event information by clicking the triangle. The event attributes appear in the Prerequisites tab, as described in Event Attributes.

Wait for Event Attributes

The following table describes the Wait for Event attributes that a successor job must wait for before it can execute:

Attribute

Description

Name

Defines the name of the event.

Rules:

  • Characters: 1-255, z/OS: 1-39

  • Case Sensitive: Yes

  • Invalid Characters: Blanks, single quotation marks, parentheses, | (pipe)

By default, the event format is [Source Job Attribute: Job Name]-TO-[Target Job Attribute: Job Name].

This format can be defined in one of the following ways:

Run Date

Defines the date attribute associated with the event, as follows:

  • Run Date: Waits for an event that has the current run date as the date.

  • Any Date: Waits for the event with any date.

  • No Date: Waits for the event with no date.

  • Previous Run Date: Waits for the event where the date is the previous run date of the successor job.

    If you manually run this job, and you have selected Ignore scheduling criteria, the event that the job waits for has a run date of yesterday.

    Job B waits for an event with a date of the Previous run date added by Job A. If Job A is scheduled to run on Monday and Wednesday, and Job B is scheduled to run on Saturday, when Job B runs on Saturday, it is waiting for the event that was added by Job A on Wednesday.

  • Next Run Date: Waits for the event where the date is the next run date of the successor job.

    If you manually run this job, and you have selected Ignore scheduling criteria, the event that the job waits for has a run date of tomorrow.

  • Specific date: Waits for a specific event date.

  • Offset: Specify a + or - followed by a number from 0 through 999, indicating the number of days in the future (+), or in the past (-), relative to the actual run date.

Delete

Determines whether the event is deleted after the successor job completed execution.

Relationship

Determines the relationship between events where the successor is waiting for more than one event, as follows:

  • AND Between All : Waits for all the events before the job executes, (default).

  • OR Between All : Waits for one of the events before the job executes.

  • Manually Set : Enables you to set the event relationship criteria manually, as follows:

    • -: Indicates no special relationship between the current and following event.

    • (: Begins a parenthetical with successive events.

    • ): Ends a parenthetical with previous events.

    • Parentheses cannot be nested.

AND/OR

Defines the relationship between the previous event and the successive event.

Event Attributes

The following table describes the Event attributes added to a predecessor job after execution enabling the successor job to execute.

Attribute

Description

Name

Defines the name of the event.

Rules:

  • Characters: 1-255, z/OS: 1-39

  • Case Sensitive: Yes

  • Invalid Characters: Blanks, single quotation marks, parentheses, | (pipe)

By default, the format is [Source Job Attribute: Job Name]-TO-[Target Job Attribute: Job Name].

This format can be defined in one of the following ways:

Run Date

Defines the date when the event is added or deleted as follows:

  • Run Date: Defines the date of the event as the run date of the job.

  • Any Date: (Delete only) Deletes all events with the specified event name.

  • No Date: Adds or deletes the event without defining the date.

  • Previous Run Date: Defines the date of the event where the date is the previous run date of the successor job.

    If you manually run this job, the date that the event is added or deleted is yesterday (ODATEClosedThe date that a job joins the Run Queue-1).

  • Next Run Date: Defines the date of the event as the next run date of the job.

    If you manually run this job, the date that the event is added or deleted is tomorrow (ODATE+1).

  • Specific Date: Defines a specific date of the event.

  • Offset: Specify a + or - followed by a number from 0 through 999, indicating the number of days in the future (+), or in the past (-),

    relative to the actual run date.

Add/Delete

Determines whether the event is added (default), or deleted from the job after it completed execution.