Date Arithmetic Calendar
This section describes how to create a calendar file using a separate Date Arithmetic GUI program named AbatDateAdmin (Date Arithmetic Admin), which is part of a basic Scheduler installation.
Fiscal Calendar and User Date Tags
The date tags specified in the table below allow you to perform date calculations on Gregorian dates. For business date calculations, a fiscal date must typically be used. The Date Arithmetic facility allows you to create a calendar in which you can specify fiscal dates for a given year. For example, you can indicate begin and end dates for a month or quarter for a specific fiscal year.
As part of business date calculations one other very important item is required. The specification of non-working days (for example, Saturday and Sunday in the United States) as well as a series of holidays that form an exception to days that would normally be considered working or business days. This information is present within one or more ActiveBatch Calendars. By specifying these ActiveBatch Calendar objects as part of your Date Arithmetic Calendar you can specify both business and non-business date tags and calculations.
Tag | Description |
---|---|
/CALENDAR=file-specification |
A calendar file. The file specification is an Execution Machine accessible file representing a calendar. |
BOFY EOFY |
Fiscal Beginning and End of Year (valid only when /CALENDAR is specified) |
BOFM EOFM |
Fiscal Beginning and End of Month (valid only when /CALENDAR is specified) |
BOFQ EOFQ |
Fiscal Beginning and End of Quarter (valid only when /CALENDAR is specified) |
BOBY EOBY |
Beginning and End of Business Year (valid only when /CALENDAR is specified and ActiveBatch Calendars have been associated with the CALENDAR) |
BOBM EOBM |
Beginning and End of Business Month (valid only when /CALENDAR is specified and ActiveBatch Calendars have been associated with the CALENDAR) |
BOBQ EOBQ |
Beginning and End of Business Quarter (valid only when /CALENDAR is specified and ActiveBatch Calendars have been associated with the CALENDAR) |
BUSDAY |
Business Day (valid only when /CALENDAR is specified and ActiveBatch Calendars have been associated with the CALENDAR) |
BUSSUNDAY – BUSSATURDAY |
Business Sunday through Business Saturday (valid only when /CALENDAR is specified and ActiveBatch Calendars have been associated with the CALENDAR). Note: In many localities, Saturday and Sunday are non-working days in which the specification of a Business Saturday or Sunday will yield no date. |
The calendar file is created using the Date Arithmetic GUI program (AbatDateAdmin). This program allows you to create a calendar file. A calendar file contains the above fiscal date tags as well as any other “user” date tags you decide to create. Each date tag can have zero or more date values associated with it. Finally, all date values are contained within a single fiscal year. This means that a valid calendar file should have date values for at least one (1) fiscal year. You can store multiple fiscal years within a single calendar file. AbatDateAdmin produces an XML file that in turn can be used to produce a binary image calendar file. The calendar file is used by the Date Arithmetic facility for fiscal date processing. This file can be downloaded onto one or more execution machines. You can generate as many calendar files, as you need.
You can also create your own date arithmetic tags. Naming rules are quite simple. You can’t name your tag so it conflicts with one of the built-in tags mentioned in this chapter. You can identify a date tag as having begin/end context. Using best practices, we recommend adding a B or an E to your date tag. So just as BOM means “beginning of month” you could create a date tag such as BSALES (beginning of sales period) and ESALES (end of sales period). There is no requirement that you create both sets of date tags. The following date tags are reserved for future use and cannot be specified: HOLIDAY, HOLIDAYS, NONBUSDAY.
Date Arithmetic Calendar Administration
AbatDateAdmin is a Windows GUI program that is used to create Date Arithmetic calendar files for fiscal and user specified date tags. Remember that you don’t have to create a calendar file for simple Gregorian calendar date tags (and their values).
When AbatDateAdmin first runs, the following dialog is presented:
Creating a Date Arithmetic Calendar
To create a new calendar file, run AbatDateAdmin (from the ActiveBatch Program Group menu) and select “File\New”.
The calendar needs to be named. You can also specify an optional description.
When you initially create a calendar, you will be prompted to create a fiscal year. A fiscal year consists of the year value itself as well as the starting and ending day of the fiscal year.
As you can see from the image above, the dialog is divided into three (3) major areas (other than the top field that notes the fiscal year). You need to specify the beginning and ending dates for the fiscal year. By default, Gregorian calendar dates are used. The next section indicates the default non-business days. This is used for simple business day calculations. We say “simple” because you can also specify ActiveBatch Calendar objects which contain both non-business days as well as holidays. The next section displays the Fiscal Quarter limits with each fiscal month.
Assigning Dates to a Date Tag
Once you’ve created an initial fiscal year you’ll see a window similar to this:
The calendar is set by default to “today” within the fiscal year. A dropdown above the calendar allows you to quickly choose different fiscal years within the calendar. The current month is shown with a Back and Next arrow allowing you to navigate to other fiscal months.
Next, you will probably want to create Date Tags to associate business dates for possible date arithmetic use. You have two (2) methods for adding a Date Tag. You can select Tag\Add Tag from the Menu bar or you can click on the ADD button in the Date Tag area. Either approach will produce the following dialog.
In the above example, we’re creating a tag named “MON_RPT_RUN” which will represent a date each month that we need a certain report run. Click OK to create the Date Tag.
The figure above shows the tag in the date tag list.
Next, you can associate dates with that tag. The easiest way of associating date(s) is to simply click on the calendar month and date that’s displayed. Each click adds your selected date. So if I want to add January 7 and 21 to the MON_RPT_RUN tag, I would click on 7 and 21. The date’s list would look like this:
To manually enter dates against a date tag, you can use the edit box (next to the ADD button in the dates list) to enter a date.
If you made a mistake, press the DELETE button on the keyboard and the last date value will be removed. Alternatively, you can select one or more dates or date tags and then right click to delete them.
Note: A date value can appear on multiple date tags. After all, January 1 could be the start of the fiscal year, month and quarter.
Once a date has been associated with a date tag the date changes color to light blue as a visual clue that the date has been associated.
Managing Date Tags
Once you’ve assigned dates to the built-in fiscal date tags you may want to create your own date tags. Remember that a date tag simply refers to one or more dates. To create a date tag, click on the Menu bar under “Edit\User Date Tags”. You’ll see a dialog box that will allow you to name the date tag and specify a description for the tag. To create the tag, click on the Add button. For example, you can create a date tag named PAYROLL that is expected to be the dates when your company pays its employees. That date could be every other Friday except when a month has five weeks. When you specify PAYROLL as in <TODAY/PAYROLL> you mean the next payroll date. Another example might be to create two date tags: BMANURUN and EMANURUN. That means <BMANURUN> would refer to the beginning of the manufacturing run and <EMANURUN> would be the end of the manufacturing run dates. ActiveBatch best practices calls for a beginning type date tag to begin with the prefix B and an ending date tag to use the prefix E. You can create a date tag with no date values. Typically a date tag will have values and B/E prefix date tags would have the same number of date values. If you want to modify the date tag, for example, change its name or description, click on the Edit button and update the desired fields.
If you decide to delete a date tag, you would select the Delete button. You’ll receive a confirmation message box asking you to confirm the deletion.
Associating Business Day and ActiveBatch Calendars
When you examine the Date Arithmetic tags you’ll notice that many correspond to the day of the week. So if today is Monday and you want to add six (6) days the resultant day will be Saturday. Date Arithmetic also supports the concept of Business Day that is pervasive throughout ActiveBatch. By default when a BUSxxxx prefix is used to denote a business date calculation, Date Arithmetic will use the non-working days section of the fiscal calendar to skip those days which are not business days. For holidays and to support multiple country or region calendars, Date Arithmetic supports the use of ActiveBatch Calendar objects. To use the facility, click on “Tag\Merge Holidays”. The following dialog will appear:
This dialog requests information to connect to an ActiveBatch Job Scheduler. By default, your Windows login credentials will be used. If alternative credentials are needed, select “Advanced Credentials” and provide a new Username and Password that should be used to make the connection. The “Test Connection” button can be pressed to determine whether the connection can be successfully made. To actually perform the connection click on the “Connect” button.
The following dialog appears if the connection was successfully established.
Adding an ActiveBatch Calendar object
Once the Calendar object has been added, you will see the reserved tag “Holiday” appear as below.
Note: You can only select one (1) Calendar at a time. To select and merge multiple Calendars require that you perform the selection process iteratively.
Save, Save As and Compile
Once you’ve created your calendar and applicable fiscal years you need to output the binary calendar file. The Save and Save As operations cause AbatDateAdmin to output an XML file. The XML file can be easily saved or subjected to source control tracking.
The Compile operation causes AbatDateAdmin to output a binary calendar file. The binary calendar file is what is actually used by the Date Arithmetic system to perform its date calculations, not the XML file. By default, AbatDateAdmin will implicitly create a new binary calendar file whenever the Save or Save As commands are performed (in other words an implicit Compile is performed). This preference can be changed via the Options menu.
Once you create the binary calendar file, it is this file that can be shipped to other execution machines and used by Date Arithmetic utilities local to that platform.
Additional File menu options include:
Import: This operation allows you to import an existing XML calendar file and use its contents.
Printable View: This menu option allows you to print your calendar.