defjob
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 defjob utility imports job processing definitions directly into the Control-M/EM database. To import the job using the defjob utility, see Importing Jobs into Existing Folders Using the defjob Utility.
The utility reads job processing definitions from a plain text input file written in XML format. See defjob XML File Rules.
For an example of the validation processes see emdef Validation Service Error Message Example.
Each job processing definition in the Control-M/EM database has a JOBISN field that contains a job ID number. JOBISN is the JOB_ID field in the def_job folder. Many jobs can have the same JOBISN number. However, the JOBISN number is unique in each Folder. Use Control-M client Monitoring Domain to determine the job ID. Select the job in the Monitoring domain to see jobs IDs.
If a job that is being imported contains a JOBISN number that already exists in the Control-M/EM database, defjob overwrites the existing job processing definition with the new job processing definition. If a JOBISN value is not specified, defjob imports the job processing definition into the database as a new job.
Importing Jobs into Existing Folders Using the defjob Utility
This procedure describes how to import jobs into existing folders into Control-M/EM database by using the defjob 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.
-
-
Type one of the following commands:
-
emdef defjob [-USERNAME <user> [-PASSWORD <password>] | -PASSWORD_FILE <password file>] -HOST <GUI Server Name> -SRC_FILE <XML file name> [/a] [-vv 2]
-
emdef defjob [-u <user> [-p <password>] | -pf <password file>] -s <GUI Server Name> -src <XML file name> [/a] [-vv 2]
For Windows, you do not need to use the emdef prefix.
-
For more information about defjob parameters and switches, see emdef General Parameters and emdef Switches.
For information about the XML file name, see defjob XML File Rules.
If there are any errors in the file, a message is displayed specifying the lines with the errors.
defjob XML File Rules
The job definitions that you create for use with the defjob utility are written in XML format, saved in a text file, and when invoked, its contents are passed to the Control-M/EM databases database. For information about creating XML files, see XML File Rules.
The following rules apply to the defjob utility XML file:
-
More than one job can be specified in a defjob file.
-
The file is case-sensitive.
-
Certain parameters are required depending on the option specified for the Type parameter. For more information, see the Type parameter in OS Job.
-
All parameter values (such as strings or digits) must be enclosed in quotation marks (for example, JOBNAME="Job1").
-
Multiple values can be specified for TO and FROM by using the * wildcard character. For an explanation of how wildcards function in the XML-based utilities, see Wildcards.
-
Condition dates must be specified in mmdd format. Time must be specified in hhmm format.
-
A parameter requiring more than one entry can be repeated as many times as necessary. For example, if a job must wait for several prerequisite conditions, specify a separate INCOND parameter for each prerequisite condition.
-
Each ON_STMT or ON_STEP parameter must be followed by at least one DO parameter. DO parameters are dependent upon the last ON_STMT or ON_STEP parameter preceding them.
-
XML is comprised of elements and attributes. Each element can contain attributes and sub-elements.
-
For more information on the XML file parameters for the defjob utility, see defjob XML File Parameters, and defjob XML File Example.
The following values can have more than one line of text:
-
Do Mail Message.
-
Do Remedy Summary.
-
Do Remedy Description.
-
Instream JCL (for z/OS).
The multi-line value is formatted in the following manner:
-
A four-digit number that indicates the length of the line
-
Text following the number
"0011hello world0012just kidding"--
If the UseMultiLineNewFormatDisplay system parameter is set to 1, then all the values appear with as line delimiters. If set to 0, or not set at all, then the following values appear as described in the above format.
defjob XML File Parameters
The following table lists the defjob file parameters:
The first two lines of the arguments file specify the XML version, the text encoding format being used, and the location of the .dtd file.
Parameter |
Description |
---|---|
DEFJOB |
Indicates the XML root element. Job processing definitions are placed between the opening and closing DEFJOB tags. One or more jobs can be specified. Each individual job is enclosed by JOB /JOB tags. |
JOB |
Indicates the opening and closing tags of a single job definition. Parameters of the job are listed between the tags. |
DATACENTER |
Determines the name of the Control-M installation to which the job belongs. |
PARENT_FOLDER |
Defines the name of the parent folder to which the job folder belongs. |
FOLDER_NAME |
Defines the name of the SMART folder to which the job belongs. |
FOLDER_DSN |
(z/OS Only) Defines the name of the library that contains the SMART folder. |
JOBNAME |
Defines the name of the job processing definition. On a Windows computer, JOBNAME must comply with Microsoft naming conventions (for example, it cannot contain / and \ characters). |
FILE_NAME |
Defines the name of the file that contains the job script. |
APPLICATION |
Provides a logical name for sorting groups of jobs. This parameter is used to supply a common descriptive name to a set of related job groups. The jobs do not necessarily have to run at the same time. |
SUB_APPLICATION |
Indicates the name of the Sub-application where the job belongs logically. It is a sub-category of the Application parameter. For example: the Application is Finances, and the Sub-application is Payroll. |
TASKTYPE |
Indicates the type of job (task) to be performed by Control-M. Valid Values:
|
CREATED_BY |
Defines the Control‑M/EM user who defined the job. This argument is used by the Control‑M/Server security mechanism and, under certain circumstances, cannot be modified. For more information, see the Security chapter and the description of the AuthorSecurity system parameter in GUI Server Parameters. |
FILE_PATH |
Defines the name of the library or directory where the job script resides. |
CMDLINE |
Defines the command string supplied when the job Task Type is Command. |
HOSTID |
Defines the host name of an Agent computer or name of a host group to which the job is submitted. |
RUN_AS |
Identifies the user name with the authorization to execute the job. This parameter is used by the Control-M security mechanism. |
MAXRERUN |
(Mandatory) Specifies the maximum number of reruns that can be performed for the job. Valid Values: 0–99 Default: 0 |
TIMEFROM |
Indicates the earliest time for submitting the job. Format is (hhmm). |
TIMETO |
Indicates the latest time for submitting the job. Format: (hhmm) or (>). |
DUE_OUT |
Determines the time that the job is expected to finish. |
PRIORITY |
Indicates Control-M job priority. 2 alphanumeric characters (AA-99). |
CRITICAL |
Indicates that the job is a critical-path job in Control-M. Valid Values:
|
CYCLIC |
Indicates whether the job is cyclic (to be run at regular intervals). Valid Values:
|
CYCLIC_TYPE |
Determines the type of cyclic job:
|
CYCLIC_TOLERANCE |
Determines the maximum delay in minutes permitted for a late submission when selecting a specific time. 5 minutes |
CYCLIC_INTERVAL_ SEQUENCE |
Describes a list of time intervals, separated by commas, of up to 4,000 characters including commas. +30M,+2H,+1D |
CYCLIC_TIMES_ |
Describes a list of times, separated by commas, which supports time synonyms. 0800,1330,2300 |
INSTREAM_JCL (embedded script) |
Defines a script exactly as it would be specified in a terminal for the specific computer and is part of the job definition. An embedded script is marked with a 
 indicator. For Control-M for z/OS, the XML file is formatted with multiple lines that contain four digit numbers which state the length of the line, followed by the line’s text. |
USE_INSTREAM_JCL |
Indicates whether the job should use the INSTREAM_JCL. Valid Values:
|
CONFIRM |
Indicates whether the job must be manually confirmed by the Control‑M/EM user before it runs. Valid Values:
Default: 0 |
AUTOARCH |
Determines whether SYSDATA is to be archived. Valid Values:
Default: 0 |
INTERVAL |
Specifies the length of time (in minutes) to wait between reruns of a job or between cyclic runs of a job. INTERVAL="00000M" Default: 0 |
OVERRIDE_PATH |
Defines the name of an alternate job script library/directory. |
MAXWAIT |
Number of extra days beyond the original scheduling date that the job is allowed to remain in the Active Jobs database awaiting execution. Integer. |
DESCRIPTION |
(Optional) Describes the job. |
DOCMEM |
Defines the name of the file containing job documentation. |
DOCLIB |
Defines the name of a library or directory containing the job documentation file. |
DAYS |
Determines the days of the month to order the job. |
DAYS_AND_OR |
Indicates the relationship between specified Days values and Weekdays values. Valid Values:
|
WEEKDAYS |
Determines the days of the week to order the job. |
DATE |
Determines specific dates to order the job in mmdd format. 10 January is written DATE="0110". |
DAYSCAL |
Defines a user defined calendar that specifies a set of days. |
WEEKSCAL |
Defines a calendar to be used to validate specified weekdays to order the job. |
CONFCAL |
Specifies a calendar that is used to validate all specified days and dates to schedule the job. |
RETRO |
Indicates whether the job is scheduled for possible execution after its original scheduling date (odate) has passed. Valid Values:
Default: 0 |
SHIFT |
Describes how to shift the scheduling date of the job. Valid Values:
|
SHIFTNUM |
Determines the number of days to shift the scheduling date of the job. Valid Values: -62–62. |
MAXDAYS |
Determines the maximum number of days to retain the SYSDATA archive dataset for jobs that ended NOTOK. Sub-parameter of AUTOARCH. Valid Values: 00–98, or 99 to indicate that SYSDATA is retained for an unlimited number of days. |
MAXRUNS |
Determines the maximum number of job runs to retain the SYSDATA archive dataset for jobs that ended NOTOK. Sub-parameter of AUTOARCH. Valid Values: 000–998, or 999 to retain SYSDATA data for all runs. |
RERUNMEM |
Defines the name of the JCL member to use when the job is automatically rerun. 1–8 characters. |
RETEN_DAYS |
(z/OS Only) Determines the number of days to retain the job in the History Jobs file. |
RETEN_GEN |
(z/OS Only) Determines the maximum number of generations of a job to keep in the History Jobs file. |
PREV_DAY |
Indicates whether a job scheduling is shifted to a previous working day in the CONFCAL calendar. Valid Values:
|
IND_CYCLIC |
Indicates whether the interval between further runs of a cyclic job is counted from the start or the end of the previous job run. Valid Values:
|
RULE_BASED_CALENDAR_RELATIONSHIP |
Determines the relationship between the specified Rule-Based Calendars and the basic scheduling criteria for the job. Valid Values:
|
SYSDB |
Determines whether one or multiple data sets are used to catalog sysdata. Valid Values:
Default: 0 |
PDSNAME |
Defines the name of a partitioned dataset (PDS) to be checked for free space. |
MINIMUM |
Determines the minimum number of free partitioned dataset tracks required by the library specified for the PDSNAME parameter. |
CATEGORY |
Defines the name of a Control-D report decollating mission category that must be scheduled under Control-D when the job is scheduled under Control-M. |
PREVENTNCT2 |
(z/OS Only) Prevents dataset clean up before the original job run. Valid Values:
Default: Blank |
JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC |
Determines the months when the job can run. Valid Values:
Default: 0 |
OPTION |
Determines the job output (OUTPUT) handling options. Valid Values:
|
PAR |
Defines certain OPTION values, such as Release and NewDest, that require additional information. |
FROM |
Limits the OUTPUT handling operation to only OUTPUTs from the specified class. |
ADJUST_COND |
Indicates whether to ignore prerequisite conditions normally set by predecessor jobs if the relevant predecessor jobs are not scheduled. This parameter is relevant only for jobs in a SMART folder. Valid Values: 0: Do not ignore. 1: Ignore relevant prerequisite conditions. Default: 0 |
CREATION_USER |
Defines the name of the user who created the job. |
CREATION_DATE |
Determines the date that the job was created. |
CREATION_TIME |
Determines the time that the job was created. |
CHANGE_USERID |
Defines the name of the user who last modified the job. |
CHANGE_DATE |
Determines the date that the job was last modified. |
CHANGE_TIME |
Determines the time when the job was last modified. |
JOB_RELEASE |
For internal use. Do not include this parameter in your defjob input file. |
JOB_VERSION |
For internal use. Do not include this parameter in your deffolder input file. |
APPL_TYPE |
Indicates the type of external application, such as SAP or Oracle, that the external application job runs on. Up to 10 characters. Mandatory for external application jobs. |
APPL_VER |
Indicates the version of the external application, such as SAP or Oracle, that the external application job runs on. Up to 10 characters. Mandatory for external application jobs. |
APPL_FORM |
Indicates a predefined set of external application parameters that are displayed in the Job Properties team. Up to 30 characters. Mandatory for external application jobs. |
CM_VER |
Indicates the version of external Application Add-on, such as SAP or Oracle, that is installed in the Control-M installation. Up to 10 characters. Mandatory for external application jobs. |
MULTY_Agent |
Broadcasts job submission details to all Agents in a specified Host Group. Valid Values:
|
ACTIVE_FROM |
(z/OS Only) Indicates the start of a period of time during which the job or SMART folder can be ordered. Format: YYYYMMDD |
ACTIVE_TILL |
(z/OS Only) Indicates the end of the time interval during which the job or SMART folder can be ordered. Format: YYYYMMDD |
TIMEZONE |
Indicates the global time zone used to calculate the interval for time-related conditions. |
SCHEDULING_ |
(z/OS Only) (Optional) Indicates the JES2 workload management scheduling environment associated with the job. String. |
SYSTEM_AFFINITY |
|
REQUEST_NJE_HOST |
Specifies the host in the JES network executes the job. |
JOBISN |
For internal use. |
RULE_BASED_CALENDAR_NAMES |
Indicates the wrapper for the Rule-Based Calendars listed with the RULE_BASED_ CALENDAR_NAME parameter. RULE_BASED_CALENDAR_NAMES RULE_BASED_CALENDAR_NAME="rbc1" RULE_BASED_CALENDAR_NAME="rbc2"
|
INCOND |
Defines an In Condition. INCOND NAME="Job1" ODATE ="ODAT" AND_OR="A"
Default: A |
OUTCOND |
Defines an Out condition. OUTCOND NAME="Job1" ODATE="ODAT" SIGN="ADD"
|
VARIABLE |
Defines a Variable expression. VARIABLE NAME="%%PARM1=%%TIME"
|
QUANTITATIVE |
Defines the Quantitative resource. QUANTITATIVE NAME="TAPEDRIVE" QUANT="1"
|
CONTROL |
Defines a Control resource. CONTROL NAME="Resc1" TYPE="E"
|
SHOUT |
Defines a Shout message. SHOUT WHEN="EXECTIME" DEST="workstation1" URGENCY="R" MESSAGE="Jobcompleted OK." TIME="1015"
|
STEP_RANGE |
Determines the step range in the job that can be used in an ON PGMST statement. STEP_RANGE NAME="cleanup" FPGMS="Defrag" TPGMS=""
|
ON |
(Optional) ON STMT="CODE" CODE="rt5" AND_OR="AND"><ON
|
DO |
Specifies a status for the job based on conditions specified in an On statement. DO ACTION="OK"
|
DOSHOUT |
Shout message wrapper. DOSHOUT DEST="Wkstn2" URGENCY="R" MESSAGE="Job5 completed OK"
|
DOCOND |
Specifies prerequisite conditions to be added or deleted. DOCOND NAME="Cond1" ODATE="ODAT" SIGN="ADD"
|
DOVARIABLE |
Defines a Variable expression. DOVARIABLE EXP="%%PARM1=%%TIME"
|
DOFORCEJOB |
Forces a specified job when the current job is performed. DOFORCEJOB DSN="45446" FOLDER_NAME="Folder2" NAME="Job4" ODATE="ODAT"
|
DOOUTPUT |
Handle job output (OUTPUT) when the job is done. DOOUTPUT OPTION="Release" PAR="F" FROM=""
|
DOIFRERUN |
Job steps to be executed during restart of a job. Available only at sites using Control-M/Restart. DOIFRERUN CONFIRM="0" FPGMS="step1" FPROCS="proc1" TPGMS="step5" TPROCS="proc3"
FPGMS: Step at which the job must be restarted. 1–8 characters. FPROCS: Program step within the called procedure. String. 1–8 characters. TPGMS: Step at which restarted job must terminate. 1–8 characters. TPROCS: Program step within the called procedure. 1–8 characters. |
DOMAIL |
Sends mail when the job run is complete. DOMAIL URGENCY="R" DEST="[email protected]" CC_DEST="[email protected]" SUBJECT="OK" MESSAGE="Task completed OK."
|
DOCTBRULE |
(z/OS Only) Invokes a Control-M/Analyzer rule to be executed during the processing of a specific program step. DOCTBRULE NAME="GOVTBAL" PAR="DOREPORT,10,%%ODATE"
|
DOREMEDY |
Opens a ticket in the Remedy Help Desk regarding the critical service.
|
IS_REFERENCE |
Indicates if the sub-folder is a reference folder. Valid Values:
Default: 0 |
REFERENCED_PATH |
Defines the full referenced path name (folder/jobname) that the sub folder references. |
defjob XML File Example
The following is an example of a defjob XML file:]
<DEFJOB>
<JOB>
FOLDER_NAME="Tbl1"
FOLDER_DSN="2232"
JOBNAME="Job1"
FILE_NAME="Job1"
SUBAPPLICATION="ACCT"
APPLICATION="App3"
DATACENTER="CTMNYC"
TASKTYPE="Command"
FOLDER_ORDER_ METHOD=""
FILE_PATH="JobLib1"
RUN_AS="Brad"
CREATED_BY="CTMEMUSER"
TIMEFROM="1210"
TIMETO="1310"
MAXRERUN="1"
INTERVAL="1"
PRIORITY="1"
CRITICAL="1"
CYCLIC="1"
CONFIRM="1"
DAYS="1,2,3"
DAYSCAL="Thurs">
<INCOND NAME="Cond1"/>
<OUTCOND NAME="Cond5"/>
<VARIABLE EXP="%%def=123"/>
<QUANTITATIVE NAME=""/>
<SHOUT WHEN="OK" DEST="COMP554" MESSAGE="Jobdone." TIME="14:30"/>
<STEP_RANGE NAME="" FPGMS="1" FPROCS="1"TPGMS="1" TPROCS="1"/>
<ON PGMS="" PROCS="" CODE="">
<DO ACTION="OK"/>
<DOVARIABLE EXP="%%def=123"/>
<DOSHOUT DEST="" MESSAGE=""/>
<DOFORCEJOB DSN="" FOLDER_NAME="Tbl1"NAME="Job4"/>
<DOCTBRULE NAME="DOCT"/>
<DOOUTPUT OPTION="Release"/>
<DOIFRERUN FPGMS="1" FPROCS="1" TPGMS="1"TPROCS="1"/>
<DOCOND NAME="COND4"/>
<DOMAIL DEST="COMP667" MESSAGE="Job done."/>
</ON>
</JOB>
</DEFJOB>