Distributed Aging Rules
Each time a date is aged, Optim™ evaluates the result and, based on a set of rules, adjusts the aged date. For example, rules can be defined such that if an aged date falls on Saturday, it is adjusted to a working day, such as Friday or Monday. To provide this semantic aging capacity, Optim™ provides the RULEDEF macro. Use this macro to define a date table that identifies categories of dates and to specify the rules to be applied to these categories.
When an aged date falls on a specified category (for example, holidays, weekend, and so on), the aging rules determine how to adjust the date (for example, forward, backward, and so on).
The RULEDEF entries in FOP2RUSA adjust the dates for many common situations such as the date falling on a Saturday, Christmas, and so on.
Date Table
The date table defined by FOP2RUSA in the RULEDEF macro identifies the dates and types of dates that require adjustment.
The following is a list of the specifications in the distributed table to adjust dates based on standard United States holidays, weekend days, and payday dates:
- WEEKEND
- Saturday and Sunday.
- HOLIDAY
- New Years Day
- Presidents Day
- Good Friday
- Memorial Day
- Independence Day
- Labor Day
- Thanksgiving Day
- Christmas Day
Since Easter and the related holidays such as Good Friday vary each year, Optim™ automatically calculates these dates.
For those dates that occur at irregular intervals, Optim™ allows you to specify explicit dates. Commented definitions for Rosh Hashanah are included in FOP2RUSA as an example.
- PAYDAY
- The fifteenth (15) and last work day of each month.
- QUARTER
- The first work day of every quarter.
Rules
The rules to apply to the dates in the date table are also defined in FOP2RUSA.
The following rules are defined using the date table built for standard United States holiday, weekends, and payday dates.
- NEXTWORKDAY
- When the date falls on a weekend day or a holiday, adjust the date to the next workday. For example, if the date is a Saturday or Sunday, adjust the date to Monday.
- PREVWORKDAY
- When the date is a weekend or a holiday, adjust the date to the previous workday. For example, if the date is a Saturday or a Sunday, adjust the date to the previous Friday.
- CLOSWORKDAY
- When the date is a weekend or a holiday, adjust the date to the closest workday. If the date is a Saturday, adjust the date to the previous Friday; if the date is a Sunday, adjust the date to Monday.
- NEXTWEEKDAY
- When the date falls on a weekend day, adjust the date to the next weekday. For example, if the date is a Saturday or Sunday, adjust the date to Monday.
- PREVWEEKDAY
- When the date is a weekend, adjust the date to the previous weekday. For example, if the date is a Saturday or a Sunday, adjust the date to the previous Friday.
- CLOSWEEKDAY
- When the date is a weekend, adjust the date to the closest weekday. If the date is a Saturday, adjust the date to the previous Friday; if the date is a Sunday, adjust the date to Monday.
- NEXTSAMEDOW
- When the date does not fall on the same day of the week as the original date, adjust the date to fall on the next same day of the week.
- PREVSAMEDOW
- When the date does not fall on the same day of the week as the original date, adjust the date to fall on the previous same day of the week.
- CLOSSAMEDOW
- When the date does not fall on the same day of the week as the original date, adjust the date to fall on the closest same day of the week.
- NEXTSTRTQTR
- When the date does not fall on a date defined as the start-of-quarter day, adjust the date to the next quarter. For example, if the date is March 15th, adjust the date to April 1 (the start of the next quarter). Note that this is further adjusted if the first day of the quarter is not a workday.
- PREVSTRTQTR
- When the date does not fall on a date defined as the start-of-quarter day, adjust the date to the previous quarter. For example, if the date is March 15th, adjust the date to January 1 (the start of the previous quarter.) Note that this is further adjusted if the first day of the quarter is not a workday.
- CLOSSTRTQTR
- When the date does not fall on a date defined as the start-of-quarter day, adjust the date to the closest quarter. For example, if the date is March 15th, adjust the date to April 1 and if the date is January 15th, adjust the date to January 1. Note that this is further adjusted if the first day of the quarter is not a workday.
- NEXTPAYDAY
- When the date does not fall on a date that is defined as a payday, adjust the date to the next payday. For example, if the date is March 5th and payday is defined as the first and the fifteenth of every month, adjust the date to March 15th.
- PREVPAYDAY
- When the date does not fall on a date that is defined as a payday, adjust the date to the previous payday. For example, if the date is March 5th and payday is defined as the first and fifteenth of every month, adjust the date to March 1st.
- CLOSPAYDAY
- When the date does not fall on a date that is defined as a payday, adjust the date to the closest payday. For example, if the date is March 5th and payday is defined as the first and fifteenth of every month, adjust the date to March 1st, the closest payday.
To use these rules, you specify the rule name in Aging Rule on the Aging Specifications or Aging Parameters panels. Optim™ checks the table built by the RULEDEF macros to determine whether an aged date falls on a date in the date table and if so, use the rule to adjust date.