exportdefcal
This utility has been deprecated. It is no longer enhanced and support will be discontinued in version 9.0.22. For more information, see emdef Utility Suite Deprecation.
The exportdefcal utility exports calendar definitions in the Control-M/EM database to an output file for use as input to other utilities.
When the exportdefcal utility is invoked, an arguments file that you prepare is processed. This arguments file contains statements that specify an existing calendar or group of calendars. The calendars that you specified in the arguments file are exported to an output file. You can modify the exported calendars in the output file and re-import them into the Control-M/EM database using the defcal utility. For more information, see exportdefcal arguments file rules.
Output files from export utilities (such as exportdefcal) can be used as input files with the import utilities (such as defcal).
exportdefcal reads arguments directly from a plain text arguments file (in XML format) instead of reading them from the command line.
The exportdefcal utility only exports Control-M level Rule-Based Calendars. To export Folder level Rule-Based Calendars, use the exportdeffolder utility (as TAGs were previously exported).
The exportdefcal utility validates the XML rule file according to the validation process in Control-M/EM version 9.0.19 and above.
By default, the utility validates the XML file in accordance with the EmdefValidationVersion system parameter in the CCM. You can change the value in the CCM without the need to add the switch to the command, which may be preferable if you have many scripts that use a particular validation version.
For an example of the two validation processes see emdef validation service error message example.
Exporting Calendar Definitions Using exportdefcal Utility
This procedure describes how export calendar definitions in the Control-M/EM database to a text file using the exportdefcal utility.
Begin
-
Do one of the following:
-
UNIX: Log in to a Control-M/EM account.
-
Windows: Open a command prompt window where Control-M/EM is installed. You do not need to be in the Control-M/EM database directory.
For Windows client installations, open a command prompt window and navigate to the <EM Instance Name>\bin directory.
-
-
Enter one of the following commands:
-
emdef exportdefcal [-USERNAME <user> [-PASSWORD <password>] | -PASSWORD_FILE <password file>] -HOST <GUI Server Name> -ARG_FILE <args file name> -OUT_FILE <File Name> [-vv 2]
-
emdef exportdefcal [-u <user> [-p <password>] | -pf <password file>] -s <GUI Server Name> -arg <args file name> -out <File name> [-vv 2]
-
For Windows, you do not need to use the emdef prefix.
For more details on the exportdeffolder parameters and options, see emdef General Parameters and emdef Switches.
exportdefcal Arguments File Rules
Arguments are used as a selection criteria to determine which calendars to export. Arguments are written to the exportdefcal argument file. The arguments files that you create with the exportdefcal utility are written in XML format and saved in a text file. The format in which this file must be written is described on the following pages.
When this file is invoked, calendar definitions are exported from the Control-M/EM database. For instructions for creating arguments files, see XML file preparation.
The following rules apply to the exportdefcal arguments file:
-
More than one calendar can be specified in an exportdefcal file.
-
The arguments file is case-sensitive.
-
All parameter values (such as strings or digits) must be enclosed in quotation marks
JOBNAME="Job1"
-
More than one PARAM parameter can be used in a TERM statement.
-
The relationship between PARAM parameters in a TERM statement is AND. The relationship between TERM statements is OR.
exportdefcal Arguments File Parameters
The following table lists the exportdefcal arguments file parameters:
Parameter |
Description |
---|---|
The first two lines of the XML request file for this API request contain information that specifies the version of XML, the text encoding format being used, and the location of the .dtd file. |
|
TERMS |
Indicates the start and end of the TERMS file. Only criteria that are located between the tags are considered to be part of the argument. |
TERM |
Indicates the start and the end of a group of selection criteria used to specify a calendar or calendars that are to be exported. Only PARAM tags that are located between the TERM tags are considered to be part of the TERM argument. REL: Relationship between terms. Valid values:
|
PARAM |
The selection criteria parameter used to determine those calendars that are to be exported. More than one PARAM can be specified. PARAM NAME="DATACENTER" OP="EQ" VALUE="Center1"
|
Exporting Calendars XML File Example
In this example, all calendars are exported in the data center named Data1. The output file contains all calendars in data center Data1 that are named Cal1.
<TERMS>
<TERM>
<PARAM NAME="DATACENTER" OP="EQ"VALUE="Data1"/>
<PARAM NAME="CALENDAR" OP="EQ" VALUE="CAL1"/>
</TERM>
</TERMS>
Exporting and Importing a Rule-Based Calendar XML File Example
In this example, an arguments file, export_def_cal.arg (shown in export_def_cal.arg exportdefcal arguments file), is used to export, all the Rule-Based Calendars that contain the "RuleBased" string in their names. The exportdefcal command (shown in export command is used to export the Rule-Based Calendar definition, RuleBasedCal, from the emdevA Control-M/EM GUI server to the RuleBaseC.txt export file. This export file is then used with the defcal command to import RuleBasedCal to the emdevB Control-M/EM GUI server.
export_def_cal.arg exportdefcal Arguments File
<TERMS>
<TERM>
<PARAM NAME="CALENDAR" OP="LIKE" VALUE="RuleBased*"/>
<PARAM NAME="TYPE" OP="LIKE" VALUE="Rule_Based"/>
</TERM>
</TERMS>
Export Command
emdef exportdefcal -u userA -p passA -s emdevA -arg \\netA\devpub\xargs\Arg\export_def_cal.arg -out \\netA\devpub\xargs\Arg\RuleBaseC.txt
The RuleBaseC.txt XML Output File
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE DEFCAL SYSTEM "defcal.dtd">
<DEFCAL >
<RULE_BASED_CALENDAR
ACTIVE_FROM="20101024"
ACTIVE_TILL="20101021"
APR="0"
AUG="0"
DATACENTER="dcDist_700"
DAYS="1,2"
DAYS_AND_OR="OR"
DEC="0"
FEB="0"
JAN="0"
JUL="0"
JUN="0"
MAR="0"
MAXWAIT="00"
MAY="0"
NAME="RuleBasedCal"
NOV="1"
OCT="0"
SEP="0"
SHIFT="IGNOREJOB"
SHIFTNUM="+00"
WEEKDAYS="0"
/>
</DEFCAL>
Import Command
emdef defcal -u useB -p passB -s emdevB -src \\netA\devpub\xargs\Arg\RuleBaseC.txt /o