Passing File Results in Control-M Jobs | Generated by AI

Home PDF

In Control-M, passing a file result from one job to the next and understanding In and Out conditions are critical for managing job dependencies and workflows. Below, I’ll explain how to pass file results between jobs and clarify the concept of In and Out conditions, including their usage, based on Control-M’s scheduling and dependency mechanisms.


1. Passing File Results to the Next Job in Control-M

To pass the result of a file (e.g., output file, data, or status) from one job to another in Control-M, you can use a combination of File Watcher jobs, AutoEdit variables, conditions, or file transfer jobs. Here are the primary methods:

Method 1: Using a File Watcher Job

A File Watcher job can detect the creation, deletion, or modification of a file and trigger the next job in the workflow. This is useful when the first job generates a file that the next job depends on.

Method 2: Using AutoEdit Variables for File Content or Path

If the first job generates a file and you need to pass its content or metadata (e.g., file path) to the next job, AutoEdit variables are ideal.

Method 3: Using Control-M Managed File Transfer (MFT)

If the file needs to be transferred between systems or locations before being used by the next job, use a Control-M MFT job.

Method 4: Using Shared Storage or Scripts

If both jobs run on the same system or have access to shared storage, the first job can write the file to a shared location, and the second job can directly access it.

Example Workflow:


2. Understanding In and Out Conditions in Control-M

In and Out conditions in Control-M are used to manage dependencies between jobs, ensuring that jobs execute in the correct order based on events or statuses.

What Are Conditions?

In Conditions

Out Conditions

Key Points About Conditions:

Example of In and Out Conditions:

Tips for Managing Conditions:


Practical Example

Scenario: Job 1 generates a report file (report.csv), and Job 2 processes it only if the file exists.

  1. Job 1 (Report Generation):
    • Type: Job:Script
    • Script: Creates /shared/report.csv.
    • Out Condition: REPORT-GENERATED-OK
    • AutoEdit Variable: %%REPORT_FILE=/shared/report.csv
  2. Job 2 (File Watcher):
    • Type: Job:FileWatcher:Create
    • Path: %%REPORT_FILE
    • In Condition: REPORT-GENERATED-OK
    • Out Condition: FILE-DETECTED-OK
  3. Job 3 (Processing):
    • Type: Job:Script
    • Script: Processes %%REPORT_FILE
    • In Condition: FILE-DETECTED-OK

Workflow:


Additional Notes


Sources

-: BMC Documentation on Job Management -: Control-M Automation API Overview -: Stack Overflow on Control-M On/Do Conditions -: Stack Overflow on Job Waiting States -: FAQ on Control-M Conditions -: Wisdom Jobs on Control-M Conditions -: BMC Documentation on Job Types -: BMC Documentation on Job Properties -: Stack Overflow on Dynamic Job Definitions -: BMC Documentation on Code Reference

If you need further clarification or a specific example tailored to your environment, please provide more details (e.g., job types, file format, or Control-M version)!


Back 2025.05.28 Donate