Actions

Action attributes are automatically performed by Control-M before or after job completion. You can define one or more of the following Actions:

If-Actions

If-Action attributes enable you to define which action Control-M performs based on the status of the job.

  • If you select Job's number of reruns to Equal to 3, and select the Set to OK action, after the job has rerun three times, the job is set to OK.

  • If you select Output cannot be found and select the notifyaction, the Alerts window is notified that an output was not found.

  • If you select Job ended, and select the Handle Output action, the output is sent to another destination, such as, copying it to another file path, when the job has ended.

  • If you select Job's number of executions to Greater than 3, and select the Rerun job action, the job is rerun when the number of job executions is greater than 3.

If Options

The following table describes the If options that you must define before creating an Action:

Options

Description

Job ended not OK

Performs the defined Action if the job ended not OK.

Job ended

Performs the defined Action if the job ended.

Job ended OK

Performs the defined Action if the job ended OK.

OS completion status

Performs the defined Action in response to the OS completion code returned by the OS.

Job's number of executions

Performs the defined Action when the number of job executions is met.

Job's number of reruns

Performs the defined Action when the number of job reruns is met.

Output cannot be found

Performs the defined Action if the output cannot be found.

Job has not been submitted

Performs the defined Action if the job returns as not submitted.

Job's number of failures

Performs the defined Action in relation to the number of times the job failed.

Specific statement output

Performs the defined Action if one of the following is fulfilled:

  • The job script file contains the character string that you define in Statement.

  • The OS response to the character string that you define contains the code characters that you define in Code.

Rules:

  • Statement: 1–132 characters in length, from the job script file, containing at least one asterisk.

  • Code: 1–255 characters in length, from the exit code of DOS BAT scripts and REXX CMD scripts that are returned to the Server.

Statement and code character strings can contain the following mask characters:

  • *: Represents any number of characters (including no characters).
  • $: Represents any single character.
  • ?: Represents any single character.

The following are statement and code combinations:

  • ON "*" "COMPSTAT>0"

  • Related to output:

    ON "*cp aaa bbb*" "*not found*"

  • Based on the OK/NOTOK state of the job:

    ON "*" "NOTOK"

Variable value

Performs the defined Actions if the logical condition defined on the variable value returns True.

Rules:

  • Variable Name: Local, Folder, or Global, as described in Variables.

    Characters: 1–128)). This includes the Pool name if the variable is in a Pool.

  • Operator: The Operator determines the relationship between the variable and the value. There are two kinds of operator types, integer operator (numeric values) or string operator (string values). Depending on the operator type selected, you might need to provide one value, either number or string, or two values, such as a Min and Max range.

  • Rules Value:

    • String:

      • 1–255 characters. The resolving string values can contain string lengths of up to 4,000 characters.

      • Special characters: '*' (asterisk).

      • String values can contain other variables.

    • Integer:

      • 1–255 characters for both the Min and Max value field combined if one of the fields contains a variable.

      • 1–10 characters for each Min and Max value field (11 characters if you are using number signs '+' or '-'), if a variable is not used.

Action Options

The following table describes the Action that Control-M can perform when the If-option is met:

Option

Description

Notify

Sends a notification to a specific destination, as described in Notify Attributes.

Set to OK

Sets the status of a job to OK, even if the job completed not OK.

Set to not OK

Sets the status of a job to not OK, even if the job completed OK.

Rerun Job

Re-executes the job.

Stop cyclic run

Stops subsequent iterations of the current cyclic job.

Set Variable

Resolves the value of a user-defined variableClosedA type of variable whose name and value you manually set in a job, which you can reference in subsequent jobs or in the same job for use in subsequent jobs, with attributes, as described in Variables

Run job and ignore scheduling criteria

Forces the execution of a job, even if the scheduling criteria is not met. .

You can also select to Run as independent flow, which determines whether the job flow in the folder executes independently from other instances of the same flow using the same events. This is achieved by adding a unique suffix to the events used in each flow instance. Run as independent flow is supported in SMART folders, sub-folders, and jobs.

Handle Output

Determines how the job handles the output:

  • Copy
  • Delete
  • Move
  • Print
  • None

Add/Delete Event

Determines whether to add or delete 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 event, as described in Events.

Notify Attributes

The following table describes the attributes for a Notify If-Action:

Attribute

Description

Destination

Determines the destination of the notification, as follows:

  • Alerts Window: Sends a notification to the Alerts window.

  • Job Log: Sends a notification to the job log.

  • NotifyScriptLnx: Sends a notification to a destination via script $CONTROLM/NotifyScriptLinux.sh in the Control-M/Agent home directory. This option appears in the If-Actions drop-down list after you manually define it as free text.

    You must create script NotifyScriptLinux.sh under the Control-M/Agent home directory.

  • NotifyScriptWin: Sends a notification to a destination via script NotifyScriptWindows.bat in the Control-M/Agent home directory. This option appears in the If-Actions drop-down list after you manually define it as free text.

    You must create script NotifyScriptWindows.bat under the Control-M Agent home directory.

    • You can only notify via script (Windows and UNIX/Linux) on OS jobs.

    • The NotifyScriptLnx or NotifyScriptWin option executes according to the user defined in the job.

Message

Defines the text of the notification message.

Rules:

  • Characters: 1–4,000

  • Case sensitive: Yes

  • Invalid characters: ' (apostrophes)

  • Variable support: A variable or expression can be specified as all or part of the value for this parameter.

Urgency

Defines the level of urgency for the message, as follows:

  • Normal

  • Urgent

  • Critical

Mail Attributes

The following table describes the mail attributes when the Destination option is set to Mail.

Attribute

Description

To

Defines an email address for recipients of the mail message.

Rules:

CC

(Optional) Defines CC email address.

On some UNIX computers, the CC field is not supported, and all recipients must go in the To field.

Rules:

  • Separate addresses with a semicolon ";".

  • Characters: 1–255

  • Case Sensitive: Yes

  • Characters:

    • Blank spaces.

    • ' (apostrophes).

    • Latin-1 special character letters (uppercase and lowercase).

  • Variable Support: A variable or expression cannot be specified as all or part of the value for this parameter.

Subject

Defines the subject line for the message.

Rules:

  • Characters: 1–99

  • Case Sensitive: Yes

  • Invalid Characters:

    • ' (apostrophes).

    • Do not use a "-" (hyphen) as the first character

  • Variable Support: A variable or expression can be specified as all or part of the value for this parameter.

Attach Output

Determines whether the output is sent as an email attachment, as follows:

  • Yes: Send the job output as an attachment.

  • No /Default : Do not send the job output as an attachment.

Notifications before Job Completion Options

The following table describes the When parameter options for Notifications before Job Completion:

Option

Description

Job not submitted by <time>

Sends a message if the job is not submitted and cannot be submitted by the time specified.

For cyclic folders and jobs this option controls the first execution only. For subsequent executions, see the Job's calculated cyclic submission is late by option.

Job's execution time

Sends a message if the elapsed job run time is outside the defined limit. A limit is expressed as the actual elapsed minutes of the job run, or as a deviation from the job (statistical) average runtime.

Rules: 1–999 minutes.

Job not finished by <time>

Sends a message if the job does not finish executing by the time specified.

Job set to rerun

Sends a message if the job completion status is set to rerun, (not valid for folders).

Job's calculated cyclic submission is late by

Sends a message if the second or subsequent cyclic submission is late by <x> minutes. You can select the Job not submitted by <time> option to send a message if the first cyclic submission is late.

If you define a cyclic job to run at 11:00, 12:00, and 13:00 and you want to receive a message if one of its cyclic job submissions is late by more than 5 minutes, you must define two Notifications Before Job Completion:

1. Job not submitted by: 11:05

2. Job’s calculated cyclic submission is late by: 5 minutes

Rules: 1–999 minutes

Notifications after Job Completion Options

The following table describes the When parameter options for Notifications after Job Completion:

Option

Description

Job ended Not OK

Sends the message if the job finished executing with an unsuccessful operating system completion status, or due to a submission failure, such as the queue does not exist.

Job ended OK

Sends the message if the job finished executing with a successful operating system completion status.

Send Notification To Attributes

The following table describes the attributes that define where notifications are sent, either before or after job completion:

Attribute

Description

Destination

Determines the destination of the notification, as follows:

  • Alerts Window: Sends a notification to the Alerts window.

  • Job Log: Sends a notification to the job log.

Message

Defines the text of the notification message as follows:

Rules:

Characters: 1–255

Case Sensitive: Yes

Invalid Characters: None

Urgency

Defines the urgency of the notification message directed to the Alerts window, see Alerts page.

Capture from Job Output Attributes

The following table describes the Capture from Job Output attributes.

Attribute

Description

Name

Defines the variable name that contains the captured data, that can be used in other jobs.

Type

Determines the variable type as described in Variables.

Cursor Position

Determines where in the output file to run the capture process as follows:

  • Move to the end of below string: Moves the cursor position to the end of the string in the output file.

  • Forward by: Selects the number of lines to skip from the search string.

  • Words/Characters: Selects the number of words or characters to skip from the search string in the output file.

  • Delimiter: Selects a delimiter type that is used as a split separator between words in the job output file.

Data to Capture

Determines the specific data to capture as follows:

  • Up to the end of line: Captures the whole string.
  • Number of words: Captures a specific number of words in a string.

Output Handling Options

The following table describes the options of the Output Handling Action attributes:

Option

Description

Output Handling

  • None: (Default).

  • Copy: Copies the output to a selected filename.

  • Delete: Deletes the output.

  • Move: Moves the output to a selected path.

  • Print: Prints the output to a selected printer.