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: Defines which action Control-M performs based on the status of the job as described in If-Actions.

  • Capture from Job Output: Captures data from the output of a job and creates a variable, which can be used by another job within the same folder, either in the script during the execution, or in post-processing actions of the job, as described in Capture from Job Output Attributes.

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"

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 (Action):

Attribute

Description

Destination

Determines the destination of the notification, as follows:

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

  • Mail: Sends an email to the indicated email addresses, see Mail Attributes.

  • 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 Linux) on OS jobs.

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

Message

Defines the text of the mail message.

Rules:

  • Characters: 1-4000

  • Case sensitive: Yes

  • Invalid characters: Single quotation marks

  • 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

Defines CC email address (Optional).

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:

    • Blanks

    • Single quotation marks

    • Latin-1 special character letters (upper and lower case)

  • 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:

    • Single quotation marks

    • Do not use "-" 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’s output as an attachment.

  • No /Default : Do not send the job’s 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).

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.

  • Mail: Sends an email to the indicated email addresses, see Mail Attributes.

  • 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.