Intermediate 3 min · March 19, 2026

AutoSys JIL — date_conditions Default Stalls Jobs

date_conditions defaults to 0, ignoring start_times, stalling jobs in WAITING.

N
Naren · Founder
Plain-English first. Then code. Then the interview question.
About
Quick Answer
  • 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.

JIL Attribute Groups JIL Attribute Groups. Key attributes by category · Identity · job_type · owner · machine · descriptionTHECODEFORGE.IOJIL Attribute GroupsKey attributes by category Identityjob_typeownermachinedescription Schedulingdate_conditionsstart_timesdays_of_weekrun_window Dependenciesconditionbox_namerun_calendarexclude_calendar Outputstd_out_filestd_err_filecommandterm_run_time Failurealarm_if_failn_retrysbox_terminatormax_run_alarm Notifynotification_emailaddressnotification_msgalarm_if_terminatedTHECODEFORGE.IO
thecodeforge.io
JIL Attribute Groups
Jil Attributes Complete Reference

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.

Core JIL Attribute Quick Reference
AttributeWhat it controlsRequired?Default if omitted
job_typeCMD, BOX, or FWYesNone — must specify
machineWhich agent runs the jobYes (CMD/FW)None
ownerOS user to run asYesNone
date_conditionsEnable time-based schedulingNo0 (disabled)
start_timesWhen to startIf date_conditions=1None
conditionDependency on other jobsNoNone (no dependency)
n_retrysAutomatic retry countNo0 (no retries)
alarm_if_failAlert on failureNo0 (no alert)
term_run_timeKill after N minutesNoNone (no limit)
std_out_fileStdout log pathNoNone (stdout discarded)
std_err_fileStderr log pathNoNone (stderr discarded)
run_calendarNamed calendar for schedulingNoNone (no calendar)
exclude_calendarExclude dates from run_calendarNoNone (no exclusion)
box_nameParent boxNoNone (not in box)
box_terminatorKill whole box on failureNo0 (no)
notificationEmail notification methodNoNone

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
    date_conditions is a master switch that controls whether time-based scheduling attributes (start_times, days_of_week, run_calendar, exclude_calendar, run_window, timezone) are effective. If set to 0 or omitted (defaults to 0), the job ignores all time scheduling and only runs when triggered by a condition or manual start. Must be set to 1 to enable time-based scheduling.
  • QWhat is the difference between n_retrys and restarting a job manually?Mid-levelReveal
    n_retrys is automatic retries performed by AutoSys without human intervention. The job is retried up to the specified count after an initial failure. Restarting a job manually (via sendevent -E FORCE_START) bypasses retry logic and resets the attempt count. n_retrys applies only to the original run; manual restarts do not count toward the retry limit.
  • QWhat attributes control failure notifications in AutoSys?SeniorReveal
    alarm_if_fail: 1 enables WCC alarm on failure. For email notification, set notification: mail along with notification_emailaddress and optionally notification_msg for custom message. The notification_message can include placeholders: %s for job name, %m for machine, %t for time. Also, max_run_alarm and min_run_alarm can send alerts for run time thresholds.
  • QWhat does term_run_time do and why is it important?JuniorReveal
    term_run_time specifies the maximum runtime in minutes after which AutoSys terminates the job (sends KILLJOB). It's critical to prevent hung jobs from blocking downstream jobs indefinitely. Without it, a job that deadlocks or waits forever can hold up the entire batch chain, causing missed SLAs.
  • QIf a job has n_retrys: 3 and fails every time, how many times does it actually run?JuniorReveal
    4 times. The initial run counts as attempt 1, and n_retrys: 3 means 3 automatic retries after the initial failure. Total attempts = 1 (initial) + n_retrys = 4. After the 4th failure, the job goes to FAILURE status.
  • QExplain the difference between box_terminator and job_terminator.SeniorReveal
    box_terminator: 1 causes the entire parent box to terminate if this job fails. All other jobs inside the box are killed. job_terminator: 1 causes only this job to terminate after failure (no retries). Use box_terminator for critical jobs whose failure makes the box's results invalid; use job_terminator to stop further automatic retries on a job that should not retry.

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

Previous
JIL Job Types: CMD, BOX and File Watcher
8 / 30 · AutoSys
Next
JIL insert_job update_job delete_job