Specifies prerequisite conditions that must be satisfied before the job is submitted for execution. The In Conditions parameter makes the submission of the job dependent on the existence of one or more prerequisite conditions.
NOTE: A maximum of 99 prerequisite conditions can be specified for the In Condition parameter.
Additional information |
Description |
---|---|
Usage |
Optional |
Format |
The In Condition parameter is composed of the Condition Name, Date, and Condition Relationships sub-parameters. |
Variable Name |
Yes. Variable system variables (but not other types of variables) can be specified as the entire value for this parameter. |
Alternate names |
|
Alternate formats |
|
Control‑M/EM Utilities |
INCOND is composed of the NAME. ODATE, AND_OR, and OP sub-parameters. The OP value is a right or left parenthesis. Used to isolate portions of the In condition expression. |
Control‑M/EM Utilities continued |
<INCOND NAME="Cond1" ODATE="ODAT" AND_OR="AND" OP=")"> |
Control-M Report |
Condition name |
Control‑M for z/OS |
Each specified prerequisite condition consists of the mandatory cond_name and dateref sub-parameters. |
Logical relationships between conditions
The logical relationship (And/Or) used when two or more prerequisite conditions are specified determines whether all or only some of the prerequisite conditions must exist in order for the job to be submitted.
Time stamp
NOTE: Not relevant in z/OS environments.
Inserting the @HHMMSS code into an In condition name includes a time stamp (in hours, minutes, and seconds) that is resolved to the time that the job is entered in the Active Jobs database.
Future and past dates
You can use the Days Offset field to set a future or past date for an In condition. Valid values for this field are a + (plus) or - (minus) sign, followed by a number from 0 through 999. The value in the field represents the number of days in the future, or in the past, relative to the actual order date.
EXAMPLE: Schedule a job that depends on the successful completion of another job
Schedule JOB_B to execute after the successful completion of JOB_A (regardless on what day JOB_A was run):
If JOB_A completes with a termination status of OK, prerequisite condition JOB_A_OK is created (with JOB_A’s original scheduling date). JOB_B, that is waiting for prerequisite condition JOB_A_OK, is submitted for execution as soon as the prerequisite condition is created.
Daily jobs
JOB_A and JOB_B are daily jobs. JOB_B should be submitted only after the successful completion of JOB_A. JOB_B must not be mistakenly submitted based on the successful completion of JOB_A from a previous day.
Assuming that the scheduling date is May 5:
If JOB_A completes with a termination status of OK, prerequisite condition JOB_A_OK is created (with the date 0505). JOB_B, that is waiting for prerequisite condition JOB_A_OK with date 0505, is submitted for execution as soon as the prerequisite condition is created.
The In Conditions parameter of JOB_B is not satisfied by the JOB_A_OK condition with a date of 0504 (created the previous day).
Schedule a job that depends on the completion of multiple jobs
Schedule the job that produces the salary statistics report for top management after the set of jobs that calculates the salaries ends OK:
When the set of jobs that calculates the salaries ends OK, it creates prerequisite condition SALARY-OK.
The report is produced twice a month, for the 1st and for the 15th. The report for the 15th is produced only if its prerequisite condition SALARY-OK exists (signifying that the 15th’s salary job ended OK). The existence of the prerequisite condition for the 1st – SALARY-OK does not enable the submission of the report for the 15th.
The report for the 1st does not necessarily run on the 1st of the month. Suppose the salary jobs only finish executing on the 3rd; only then is the prerequisite condition SALARY-OK for the 1st created. This is because the prerequisite condition is always associated with a scheduling date, and not with the actual running date. Therefore, a date reference should be added to the condition:
Consider a similar example: a monthly total report must be produced based on data from the last two runs. Also, the job must run when communication channels to a remote site are active:
The job is submitted only if the jobs for the 1st and the 15th have finished. Prerequisite condition COMM-ACTIVE is based on a "generic" date reference that exists only when communication is active.
The communication process itself can be monitored by Control‑M. When communication is not active, Control‑M deletes prerequisite condition COMM-ACTIVE, preventing abends of jobs that depend on active communication.
Maintain order of job runs
Assume a group of jobs runs every day of the week, except Saturday and Sunday. It is very important that some of the jobs scheduled for the various days of the week do not run in parallel. The order of these jobs must be maintained even in cases of delays:
The job is submitted only if the prerequisite condition DEPOSITS of the previous scheduling date exists. The prerequisite condition DEPOSITS is created only after the group of jobs called DEPOSITS finishes.
Job scheduling that depends on site conditions
Suppose a Database master data set exists, and that it is accessed by many programs. Unfortunately, the contents of the Database are often destroyed or damaged because of bugs in old programs. When, and if, it is discovered that the contents of the Database are corrupted, submission of all the jobs that access the file must be prevented:
It has been discovered that the Database contents are indeed "bad." At this point, prerequisite condition MASTER-FILE-OK must be deleted, either manually from Control‑M/EM, or automatically by the job or process that made the discovery. When the Database is restored to its normal state, the prerequisite condition is added again and execution proceeds as planned.
Job scheduling when a failure has occurred
A detached process, LOGCLOSE, is to begin whenever a certain communication process crashes because of a boot operation, or as a result of an operator’s cancelation:
The detached process LOGCLOSE starts executing whenever prerequisite condition COMM-CANCELED is active. The prerequisite condition is added by Control‑M when the communication process is canceled by an operator or after a computer crash.
Date reference
The following example provides a further explanation of the concept of the scheduling date reference:
Today is the 15th of September. The date reference values resolved in this job are written in mmdd date format:
Condition including terms isolated with parentheses
ctmcreate -tasktype command -cmdline ls -jobname cond_600 -incond cond_21 ODAT AND -incond '('cond_22 ODAT OR -incond cond_23')' ODAT AND -incond cond_24 ODAT OR
Out condition name including a time stamp
ctmdefine -tasktype command -cmdline date -application app -sub_application grp -folder time_cond -days ALL -month ALL Y -outcond a@HHMMSS ODAT ADD -jobname counter -memname counter
The resulting Out condition statement:
*CONDITION a101028 0113 ADDED
Today is the 15th of September. The date reference values resolved in this job are written in mmdd date format:
Parent Topic |