AutoSys JIL — date_conditions Default Stalls Jobs
date_conditions defaults to 0, ignoring start_times, stalling jobs in WAITING.
- JIL attributes define identity, schedule, dependencies, error handling, output, and resource control
- Common trap: date_conditions defaults to 0 — start_times are ignored without it
- n_retrys is retries after initial failure; total attempts = n_retrys + 1
- Always set std_err_file — without it, error output vanishes into /dev/null
- box_terminator kills the parent box on failure — use only for critical kill switches
A JIL job definition can contain dozens of attribute statements, each controlling a different aspect of how the job behaves. You don't need to memorise all of them, but you do need to know the commonly used ones by heart and know where to find the rest.
This article covers every attribute you'll encounter in production AutoSys environments, grouped by what they control. Each attribute includes its purpose, valid values, and a note on when it matters.
Identity attributes
These attributes define the basic identity of the job. They are the first things AutoSys reads when processing a job definition. Without a name, type, owner, and machine, the job cannot exist. The permission attribute controls visibility and who can modify or run the job — a practical concern in shared environments where multiple teams manage the same scheduler.
Scheduling attributes
These attributes control when the job runs. The most common mistake is forgetting date_conditions: 1 — without it, start_times, days_of_week, run_calendar are all ignored. The run_window attribute restricts when the job may run (useful for overnight batch windows). Timezone is often overlooked but critical when your agents are in different timezones than your control server.
Dependency and condition attributes
These attributes define what must be true before this job can start. Conditions use built-in functions: success(job), failure(job), done(job), notrunning(job). Multiple conditions can be combined with AND and OR. The box_name attribute links the job to a parent box — the box must be RUNNING for the job to start. Job_load and max_run_alarm provide load and runtime monitoring.
Output and logging attributes
Always set these. Debugging any AutoSys job failure without log files is extremely painful. The std_out_file captures standard output, and std_err_file captures standard error. If std_err_file is not set, error messages are lost. Use the > prefix to append instead of overwrite. You can also redirect to syslog using the \$AUTOUSER variable.
Failure handling and retry attributes
These attributes control what happens when a job doesn't succeed on its first attempt. The n_retrys attribute is often misunderstood — it's the number of retries after the initial failure, so a job with n_retrys: 3 runs up to 4 times total. term_run_time is your safety net against hung jobs; without it, a stuck job can block an entire chain indefinitely. alarm_if_fail sends a WCC alert on final failure. box_terminator and job_terminator let you cascade failures.
Job lifecycle attributes: insert_job, update_job, delete_job
This isn't a JIL attribute but a JIL command that defines how jobs are created and modified. insert_job creates a new job; using the same job name again with insert_job updates the existing job (not an error). update_job changes attributes on an existing job without affecting the schedule. delete_job removes the job definition. One-time overrides can be applied with job_name.start_times etc. in a separate JIL file.
Calendars and global variables
AutoSys allows the use of named calendars to define complex schedules. A calendar is a JIL object that defines a set of dates (e.g., month-end, holidays). Jobs can reference calendars via run_calendar and exclude_calendar attributes. Global variables are defined using \$VAR syntax and can be shared across jobs. They are resolved at runtime by the agent.
| Attribute | What it controls | Required? | Default if omitted |
|---|---|---|---|
| job_type | CMD, BOX, or FW | Yes | None — must specify |
| machine | Which agent runs the job | Yes (CMD/FW) | None |
| owner | OS user to run as | Yes | None |
| date_conditions | Enable time-based scheduling | No | 0 (disabled) |
| start_times | When to start | If date_conditions=1 | None |
| condition | Dependency on other jobs | No | None (no dependency) |
| n_retrys | Automatic retry count | No | 0 (no retries) |
| alarm_if_fail | Alert on failure | No | 0 (no alert) |
| term_run_time | Kill after N minutes | No | None (no limit) |
| std_out_file | Stdout log path | No | None (stdout discarded) |
| std_err_file | Stderr log path | No | None (stderr discarded) |
| run_calendar | Named calendar for scheduling | No | None (no calendar) |
| exclude_calendar | Exclude dates from run_calendar | No | None (no exclusion) |
| box_name | Parent box | No | None (not in box) |
| box_terminator | Kill whole box on failure | No | 0 (no) |
| notification | Email notification method | No | None |
Key Takeaways
- Always set std_out_file and std_err_file on every CMD job — they are your primary debugging tools
- date_conditions: 1 must be set for start_times to take effect — without it, time-based scheduling is disabled
- n_retrys: 3 means 3 retries after initial failure — the job runs up to 4 times total
- term_run_time terminates a hung job after N minutes — critical for preventing downstream job pile-ups
- Permissions matter in shared environments — use permission attribute to control access
- Calendars centralise scheduling — one change affects all jobs referencing that calendar
- Use box_terminator sparingly — only for jobs whose failure invalidates the entire box
Common Mistakes to Avoid
- Not setting std_out_file and std_err_file
Symptom: When a job fails, you have no logs to inspect. Error output goes to AutoSys's internal log, which is hard to access.
Fix: Add std_out_file and std_err_file to every CMD job. Use consistent paths like /logs/autosys/jobname.out and .err. - Setting date_conditions: 0 and expecting start_times to work
Symptom: Job never starts at the intended time because start_times is ignored when date_conditions is 0.
Fix: Always set date_conditions: 1 when using start_times, days_of_week, or run_calendar. - Forgetting that n_retrys: 3 means 3 retries after initial failure
Symptom: Job runs up to 4 times total. If each run takes 30 minutes, the job runs for 2 hours before failing.
Fix: Understand the counting: n_retrys counts retries after the first failure. Total attempts = n_retrys + 1. - Not setting term_run_time
Symptom: A hung job runs forever, blocking downstream jobs and causing SLA misses.
Fix: Add term_run_time to every job that could hang. A value of 120 minutes is a reasonable default for most batch jobs. - Setting alarm_if_fail: 0 (default) and expecting alerts
Symptom: Job fails at 3 AM but no one is notified. The failure is discovered hours later by a downstream impact.
Fix: Set alarm_if_fail: 1 for all critical jobs. Optionally configure notification email or SNMP trap. - Using box_terminator on a non-critical job
Symptom: A minor job fails, and the entire box terminates, killing other jobs unnecessarily.
Fix: Only set box_terminator: 1 for jobs that are truly critical to the box's success. Use job_terminator for self-termination.
Interview Questions on This Topic
- QWhat does the date_conditions attribute do in AutoSys JIL?JuniorReveal
- QWhat is the difference between n_retrys and restarting a job manually?Mid-levelReveal
- QWhat attributes control failure notifications in AutoSys?SeniorReveal
- QWhat does term_run_time do and why is it important?JuniorReveal
- QIf a job has n_retrys: 3 and fails every time, how many times does it actually run?JuniorReveal
- QExplain the difference between box_terminator and job_terminator.SeniorReveal
Frequently Asked Questions
What is date_conditions in AutoSys?
date_conditions controls whether time-based scheduling (start_times, days_of_week, run_calendar) is active for a job. Set to 1 to enable time-based scheduling; set to 0 to disable it. If date_conditions is 0, the job only runs when triggered by a condition (another job's success/failure) or manually.
How does n_retrys work in AutoSys?
n_retrys specifies how many times AutoSys automatically retries a failed job before declaring it a final FAILURE. If n_retrys is 3 and the job fails, AutoSys retries 3 times for a total of 4 attempts. After all retries are exhausted, the job moves to FAILURE status.
What happens if term_run_time is not set?
Without term_run_time, a job that hangs or runs indefinitely will continue forever. This can block all downstream jobs waiting on it. Always set a reasonable term_run_time to ensure hung jobs are terminated automatically.
What is the box_terminator attribute in AutoSys?
box_terminator: 1 marks a job as the 'kill switch' for its parent box. If this job fails, the entire box (and all remaining jobs in it) is terminated immediately, rather than waiting for other jobs to complete or fail.
How do I send email notifications from AutoSys?
Set alarm_if_fail: 1 and configure notification attributes: set notification: mail and notification_emailaddress: your-team@company.com. You can also customise the notification message with the notification_msg attribute, which supports placeholders like %s (job name), %m (machine), %t (time).
What is the difference between run_window and start_times?
start_times defines specific times when the job can start. run_window defines a time range during which the job is allowed to run. If a job starts at a start_time but runs past the run_window end, AutoSys terminates it. run_window is useful for batch windows (e.g., overnight only).
Can I use both date_conditions and condition together?
Yes. When both are present, the job starts only when the time conditions are satisfied AND the condition dependencies are met. This is common for jobs that run at a specific time but wait for upstream tasks to finish.
That's AutoSys. Mark it forged?
3 min read · try the examples if you haven't