ctmcontb

The ctmcontb utility performs the following operations on prerequisite conditions in the Control-M/Server database:

  • -LIST: Lists existing prerequisite conditions while treating an asterisk in a condition name as a wildcard.

  • -LISTNOWILD: Lists existing prerequisite conditions while treating an asterisk in a condition name as a regular character.

  • -ADD: Adds a prerequisite condition.

  • -XML: Generates a prerequisite condition in XML format.

  • -DELETE: Deletes a prerequisite condition while treating an asterisk in a condition name as a wildcard.

  • -DELETENOWILD: Deletes a prerequisite condition while treating an asterisk in a condition name as a regular character.

  • -DELETEFROM: Deletes conditions within a specified range of dates.

  • -CLEAN -EXCLUDE: Cleans and excludes a condition

The following special characters are disabled when they occur in prerequisite condition names:

  • (: open parenthesis

  • ): close parenthesis

  • |: vertical bar

  • space

Viewing and Modifying Prerequisite Conditions

This procedure describes how to run the ctmcontb utility, which enables you to perform operations on prerequisite conditions in the Control-M/Server database.

Begin

  1. Do one of the following:

    • UNIX: Log in to a Control-M/Server account

    • Windows: Open a command prompt window where Control-M/Server is installed.

    You can also run this utility in Control-M Agent by navigating to where Control-M/Agent is installed.

  2. Do one or more of the following:

    • To list conditions, run one of the following commands:

      • ctmcontb -LIST <Condition Name> <Condition Date> [-OUTPUT <Output file name>][-FULLDETAILS]

      • ctmcontb -LISTNOWILD <Condition Name> <Condition Date> [-OUTPUT <output file name>][FULLDETAILS]

      • ctmcontb -input_file <Full path file name>

    • To delete a range of conditions, run one of the following commands:

      • ctmcontb -DELETEFROM <Condition Name> <From Date> <To Date>

      • ctmcontb -input_file <Full Path file name>

      • ctmcontb -CLEAN <Condition Name> -EXCLUDE <Condition Name> <From Date> <To Date>

    • To clean and exclude a condition, run the following command:

      • ctmcontb -CLEAN <Condition Name> -EXCLUDE <Condition Name> <From Date> <To Date>

    • For all other operations, run one of the following commands:

      • ctmcontb {-ADD|-XML|-DELETE|-DELETEONWILD} <Condition Name> <Condition Date>

      • ctmcontb -input_file <Full Path file name>

ctmcontb Utility Parameters

The following table lists the ctmcontb utility parameters:

Variable

Description

-FULLDETAILS

Displays the prerequisite condition name without truncation.

<Condition Name>

  • For LIST, DELETE , and DELETEFROM:

    • The condition name can include the wildcard character * to indicate any number of characters (including none).

    • Maximum length for a condition name is 255 characters.

    • When using *, the condition name must be enclosed in quotation marks

      "LVL*"

    • Specify "*" by itself to include all existing conditions.

    • When using both open and closed square brackets ([ and ]), the condition name must be enclosed in quotation marks

      "RATE[A1]"

  • For LISTNOWILD and DELETENOWILD:

    • The character * in condition name is referred to as a regular character.

    • When using an *, the condition name must be enclosed in quotation marks.

    • When using both open and closed square brackets ([ and ]), the condition name must be enclosed in quotation marks.

    • Maximum length for a condition name is 255 characters.

  • For Adding or Generating in XML Format

    • When using both open and closed square brackets ([ and ]), the condition name must be enclosed in quotation marks.

    • Maximum length for a condition name is 255 characters

  • For CLEAN and EXCLUDE:

    • When the action is set to Clean, a condition name can be set to identify the condition names to clean.

    • CLEAN: Condition to be cleaned regardless of its date. Can contain wildcard characters.

    • EXCLUDE: Condition which is excluded from clean up.

      • Condition name up to 255 characters

      • Can contain wildcard characters

      • From date: From condition date

      • To date: to Condition date

      • Date elements have the format yyyymmdd, yymmdd, or mmdd. Only the mmdd part is used by the utility.

        You can have multiple exclude parameters within the same command (up to 20).

<Condition Date>

Displays the date of the prerequisite condition in mmdd format.

  • For Listing and Deleting:

    • The condition date can include wildcard character * to indicate any number of characters (including none).

    • When using an *, enclose the date in quotation marks

      "12* "

    • Specify "*" by itself to include all dates.

    • Specify ODAT to accept the Control‑M date.

    • Specify STAT if a date is not relevant.

  • For Adding or Generating in XML Format:

    • Specify ODAT to use the Control‑M working date.

    • Specify STAT if a date is not relevant.

<From Date> <To Date>

For Deleting in a Date Range:

  • Displays the starting and ending dates for date range of prerequisite conditions to delete.

  • Each date is in mmdd format.

<output file name>

For Listing:

  • Displays the full path name to send the report.

  • If this parameter is not specified, the output is routed to the default output device—the terminal.

<Full Path file name>

  • Displays the name and full path of a file containing parameters for the utility.

  • In this file, each parameter and its values (if any) are on a separate line with the same syntax they would have on the command line.

  • Using the -input_file parameter enables you to:

    • Prepare, save, and reuse files of utility parameters.

    • Specify utility input longer than the number of characters allowed in the command line.

-input_file /ctm_server/data/ctmcontb_list.txt

ctmcontb Examples

The following command deletes prerequisite condition bckp_end with condition dates in December:

ctmcontb -DELETE bckp_end "12*"

The following command deletes all prerequisite conditions with prefix a and condition dates between December 1 and December 15 inclusive:

ctmcontb -DELETEFROM "a*" 1201 1215

The following command deletes the prerequisite condition aa* with condition date ODAT:

ctmcontb -DELETENOWILD "aa*" ODAT

You can implement the second example with the -input_file parameter as follows:

ctmcontb -input_file ~<controlm_owner>/ctm_server/data/ctmcontb_delfr.txt

Where the referenced file contains the line:

-DELETEFROM "a*" 1201 1215

The following command lists the prerequisite condition named aa* with all its dates:

ctmcontb -LISTNOWILD "aa*" "*"

The following command lists all existing prerequisite conditions:

ctmcontb -LIST "*" "*"

A report similar to the following example is generated:

Copy
Date: 30-JUN-2021. Page 1Conditions list
CONDNAME    CONDDATE
APR01-L20   0629
APR01-L20   0630
ARD01-L30K  0630
LVL11-LVL22 0628
LVL11-LVL22 0629
LVL11-LVL22 0630
PKR11-LVL01 0630

This example demonstrates the advantage of defining a Control‑M job to run a utility. The following job processing definition causes Control‑M to run ctmcontb each work day, each time deleting all prerequisite conditions that are between five and ten days old:

Week Days 2,3,4,5,6

Variable Assignment
%%A=%%CALCDATE %%DATE -10

%%B=%%CALCDATE %%DATE -5

%%A=%%SUBSTR %%A 3 4

%%B=%%SUBSTR %%B 3 4

Command Line ctmcontb ‑DELETEFROM "*" %%A %%B

This example illustrates ctmcontb input and output when using the -XML option. ODAT automatically generates the Control-M/Server system date that, in this example, was March 15th.

Copy
D:\>ctmcontb -XML cond1 ODAT
<?xml version="1.0" encoding="utf-8" ?>
<CTMCONTB
 CONDNAME="cond1"
 CONDDATE="0315">
 <COND
CONDNAME="cond1"
CONDDATE="    0315">
  </COND>
</CTMCONTB>

This example cleans all conditions and excludes conditions that start with "A" between May and June,

and excludes conditions that start with A between August 10th and August 20th:

ctmcontb -clean "*" -exclude A* 0501 0630 -exclude B* 0810 0820