Exporting Table Output

A lot of scripts ans example to extract information from Control-M tools.
User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 08 Mar 2007 5:08

Hi,

There are different utilities to export and import jobs or tables from a DATACENTER.

To the jobs, exportdefjob and defjob,
To the Tables exportdeftable and deftable

example :
To Export

Create a text file including following information (defjob.txt for our example):
<xml>
<DOCTYPE>
<TERMS>
<TERM>
<PARAM NAME="TABLE_NAME" OP="EQ" VALUE="Your Table" " />
<PARAM>
</TERM>
</TERMS>


and launch following command (unix syntax):

To export jobs definitions included in a table
exportdefjob -HOST CTM_SERVER -USERNAME EM_USER -PASSWORD EM_Password -ARG_FILE defjob.txt -OUT_FILE result.txt

To export all the table contains including TABLE parameters
exportdeftable -HOST CTM_SERVER -USERNAME EM_USER -PASSWORD EM_Password -ARG_FILE defjob.txt -OUT_FILE result.txt

You will find in result.txt jobs definition in XML format.


To Import
Using same jobs definition in XML format you could import jobs or table directly in your EM database.

Be carefull, if you try to import several time same jobs defintion without to delete existing table, you will duplicate jobs in your table.
And if you try to import an existing table, your importation doesn't run correctly without to delete that existing table too.

To import jobs definitions only
defjob -HOST CTM_SERVER -USERNAME EM_USER -PASSWORD EM_Password -SRC_FILE result.txt

To import all the table
deftable -HOST CTM_SERVER -USERNAME EM_USER -PASSWORD EM_Password -SRC_FILE result.txt

After that, you must upload Tables to your CONTROL-M Server.

Other utilities could be used for CALENDAR.

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 09 Mar 2007 4:10

Which product version do you used?

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 09 Mar 2007 4:33

Hi,

Syntax changed betwen 5.0.xx and 6.x.xx.
Command syntax was :

export_def_table
export_def_job
export_defcal
import_def_table....

User avatar
fyot
Nouveau
Nouveau
Posts: 736
Joined: 26 Apr 2005 12:00
Location: PARIS
Contact:

Post by fyot » 12 Mar 2007 1:14

Hi,

Normally your ecs login must have all rights and variables necesary to have an access with your database, as root_menu.

So considering your environment, I could suggest to you, only to upgrade your ECS to Control-M/EM 6.2.xx or 6.3.xx.

Support for this version of ECS is stopped since a long time, and the current available version of Control-EM is tottaly compatible with a Control-M Server 2.24.00. No need to update all your architecture.

And the best things will be to have all utilities to extract and import jobs definition using XML format.

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Exporting Table Output

Post by Walty » 12 Mar 2007 8:38

Hi,

i use until the end of the year one (same) environement composed by :

Control-M/Server for UNIX - V2.24.05
Control-M/Agent for UNIX ? V2.24.00 & V2.24.05
Control-M/Enterprise Manager (ECS) ? V5.0.08

You have 2 syntax for the <export_def_table> utility, and every syntax run correctly in my system

1. Use an Xterm window.
2. Log in as the ENTERPRISE/CS administrator (ecs)
3. Specify the following command:

Example 1
export_def_table -dc from_datacenter -table from_table [-lib from_lib] -u username -p password -file export_file
export_def_table -dc PROD1 -table mainday -u ecs -p ecspass -file /tmp/file1.out

where:

-dc Data center of the source Scheduling table.
-table Source Scheduling table name.
-lib Source library (MVS only).
-u ENTERPRISE/CS administrator?s database log-in name (ecs)
-p ENTERPRISE/CS administrator?s database password (ecspass)
-file Full path of the file to contain the exported Scheduling table.

Example 2
export_def_table <from_dc> <from_table> [<from_lib>] <user> <password> <file_name>
export_def_table PROD1 mainday ecs ecspass /tmp/file2.out

where:

<from_dc> Data center of the source Scheduling table.
<from_table> Source Scheduling table name.
<from_lib> Source library (MVS only).
<user> ENTERPRISE/CS administrator?s database log-in name (ecs)
<password> ENTERPRISE/CS administrator?s database password (ecspass)
<file_name> Full path of the file to contain the exported Scheduling table.

The command should be specified entirely on a single line and the source Scheduling table should not be in use when this utility is run.

Regards
Walty

User avatar
rossbertoloni
Nouveau
Nouveau
Posts: 7
Joined: 14 Jun 2007 12:00

how to view xml file in CONTROL-M/Desktop

Post by rossbertoloni » 14 Jun 2007 6:48

Hi.

How can I view the output xml file from export utility exportdefcal in the CONTROL-M/Desktop?
That is how can I convert the xml file to the format readable by CONTROL-M/Desktop?


Thanks
Ross

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

how to view xml file in CONTROL-M/Desktop

Post by Walty » 14 Jun 2007 10:08

Hi,

You can modify the exported Calendars by <exportdefcal> in the output file and re-import them in to the CONTROL-M/EM database using the <defcal> utility.
The defcal utility imports a Calendar definition directly from a plain text input file (XML format issue from exportdefcal or your definition) in to the CONTROL-M/EM database.

usage : defcal -s <host_name> -u <user> -PASSWORD <password> -src < XML_file_name>

After this action you can read the definition with the Control-M/Desktop

Regards
Walty

meninmech

Post by meninmech » 24 Oct 2008 6:15

hi all,

am new to control-M . am using control-m version 6.XX

if i try to execute the following commands in unix

export_def_table
export_def_job
export_defcal
import_def_table....

am getting the following error

ksh: export_def_table: not found.

could you help me on how to proceed ?

Post Reply