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 Using the ctmcontb Utility
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
-
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.
-
-
Do one or more of the following:
-
Run one of the following commands to list conditions:
-
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>
-
-
Run one of the following commands to delete a range of conditions:
-
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>
-
-
Run the following command to clean and exclude a condition:
-
ctmcontb -CLEAN <Condition Name> -EXCLUDE <Condition Name> <From Date> <To Date>
-
-
Run one of the following commands for all other operations:
-
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> |
|
<Condition Date> |
Displays the date of the prerequisite condition in mmdd format.
|
<From Date> <To Date> |
For Deleting in a Date Range:
|
<output file name> |
For Listing:
|
<Full Path file name> |
|
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:
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.
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