Home DevOps AutoSys Calendars and run_calendar — Scheduling by Business Calendar

AutoSys Calendars and run_calendar — Scheduling by Business Calendar

Where developers are forged. · Structured learning · Free forever.
📍 Part of: AutoSys → Topic 15 of 30
AutoSys calendars let you schedule jobs on business days, holidays, and custom date patterns.
⚙️ Intermediate — basic DevOps knowledge assumed
In this tutorial, you'll learn:
  • AutoSys calendars are named date lists that let you schedule jobs on business days, holidays, or any custom date pattern
  • Use run_calendar to specify which days to run; use exclude_calendar to skip specific dates like public holidays
  • Calendars are created and managed with the autocal_asc command
✦ Plain-English analogy ✦ Real code with output ✦ Interview questions
⚡ Quick Answer
AutoSys calendars are custom day lists — like a company holiday calendar for your batch jobs. Instead of just 'run on weekdays', you can say 'run on every business day that isn't a public holiday or month-end close' — and AutoSys handles the date logic for you.

Time-based scheduling with days_of_week covers most simple cases, but enterprise batch processing often needs more nuanced scheduling. Month-end jobs that only run on the last business day. Jobs that must skip public holidays. Quarter-end runs. AutoSys calendars solve exactly this.

There are two calendar types: standard calendars (a list of dates) and extended calendars (built from logical rules). Both are defined using the autocal_asc command or through the WCC UI.

Standard calendars — a list of dates

A standard calendar is simply a named list of dates. Jobs with run_calendar: your_calendar_name will run on those dates and only those dates.

create_calendar.sh · BASH
1234567891011121314
# Create a standard calendar using autocal_asc (interactive or file mode)
autocal_asc << 'EOF'
insert_calendar: business_days_2026
calendar_type: standard
dates: 20260102, 20260105, 20260106, 20260107, 20260108, 20260109
/* ... continuing for all business days in 2026 ... */
EOF

# Create a holiday exclusion calendar
autocal_asc << 'EOF'
insert_calendar: uk_public_holidays_2026
calendar_type: standard
dates: 20260101, 20260403, 20260406, 20260504, 20260525, 20260831, 20261225, 20261228
EOF
▶ Output
Calendar 'business_days_2026' successfully created.

Using run_calendar and exclude_calendar

Once calendars are defined, apply them to jobs with run_calendar (run on these days) and exclude_calendar (don't run on these days).

calendar_job.jil · BASH
1234567891011121314151617181920
/* Run on all business days in 2026, but skip UK public holidays */
insert_job: daily_settlement
job_type: CMD
command: /scripts/settlement.sh
machine: finance-server
owner: finuser
date_conditions: 1
start_times: "18:00"
run_calendar: business_days_2026
exclude_calendar: uk_public_holidays_2026

/* Month-end job: runs only on last business day of each month */
insert_job: month_end_close
job_type: CMD
command: /scripts/month_end.sh
machine: finance-server
owner: finuser
date_conditions: 1
start_times: "20:00"
run_calendar: month_end_2026
🔥
Calendars need to be updated annuallyStandard calendars with explicit dates need to be refreshed each year. Most enterprises have an automated process or a dedicated admin task to update business day and holiday calendars at the start of each year.

Viewing and managing existing calendars

You can query, list, and report on existing calendars using autocal_asc in report mode. This is useful when you need to audit which jobs are using which calendars, or verify a calendar's dates before a major batch run.

manage_calendars.sh · BASH
12345678910111213
# List all calendars in the AutoSys instance
autocal_asc -r %

# View dates in a specific calendar
autocal_asc -r business_days_2026

# Delete an obsolete calendar
autocal_asc << 'EOF'
delete_calendar: old_2025_holidays
EOF

# Find all jobs using a specific calendar
autorep -J % -q | grep -B5 'run_calendar: business_days_2026'
▶ Output
Calendar: business_days_2026
Type: standard
Dates: 20260102, 20260105, 20260106 ... (247 business days)
🔥
Calendar names are case-sensitiveIf you define a calendar as 'Business_Days_2026' but reference it in JIL as 'business_days_2026', AutoSys won't find it. Keep calendar names lowercase with underscores to match standard JIL naming conventions.
Scheduling methodUse when...Attributes used
days_of_weekSimple day-of-week rulesdays_of_week: mon-fri
run_calendarCustom date lists (business days, month-end)run_calendar: calendar_name
exclude_calendarSkip specific dates (holidays)exclude_calendar: calendar_name
Both run_calendar + exclude_calendarBusiness days minus holidaysBoth attributes together

🎯 Key Takeaways

  • AutoSys calendars are named date lists that let you schedule jobs on business days, holidays, or any custom date pattern
  • Use run_calendar to specify which days to run; use exclude_calendar to skip specific dates like public holidays
  • Calendars are created and managed with the autocal_asc command
  • Standard calendars with explicit dates must be updated annually

⚠ Common Mistakes to Avoid

  • Not updating calendars at year-end — jobs scheduled on the old calendar stop running on the new year's business days
  • Setting both days_of_week AND run_calendar — when both are set, a job runs on the intersection: days that appear in both
  • Forgetting to create the exclude_calendar before referencing it in a job definition
  • Using standard calendars where an extended calendar with business day logic would be more maintainable

Interview Questions on This Topic

  • QWhat is a run_calendar in AutoSys?
  • QWhat is the difference between run_calendar and exclude_calendar?
  • QHow do you create a calendar in AutoSys?
  • QWhat is the autocal_asc command used for?
  • QWhat happens if both days_of_week and run_calendar are set on a job?

Frequently Asked Questions

What is run_calendar in AutoSys?

run_calendar is a job attribute that specifies a named AutoSys calendar. The job will only run on the dates defined in that calendar, rather than using the standard days_of_week scheduling.

How do I create an AutoSys calendar?

Use the autocal_asc command to create, update, and manage calendar definitions. You can run it interactively or redirect a calendar definition file to it. The WCC web interface also has a calendar management section.

What is exclude_calendar in AutoSys?

exclude_calendar specifies dates on which the job should NOT run, even if those dates are in the run_calendar or match days_of_week. It's commonly used to exclude public holidays from a business day schedule.

What happens when both days_of_week and run_calendar are set?

When both are set, the job runs on days that satisfy BOTH conditions — the day must be in the run_calendar AND must be one of the specified days_of_week. This is typically not intended; usually you set one or the other.

Do AutoSys calendars need to be updated each year?

Yes, if you're using standard calendars with explicit date lists, they must be updated to include the new year's dates. Many organisations automate this as an annual administrative task at year-end.

🔥
Naren Founder & Author

Developer and founder of TheCodeForge. I built this site because I was tired of tutorials that explain what to type without explaining why it works. Every article here is written to make concepts actually click.

← PreviousAutoSys Job Dependencies and ConditionsNext →AutoSys Global Variables
Forged with 🔥 at TheCodeForge.io — Where Developers Are Forged