Date Arithmetic Uses and Syntax

This section discusses Date Arithmetic uses and syntax. Date Arithmetic calculates dates using a wide variety of commands and optional qualifiers. You can use the dates in various ways, discussed below.

 

Date Arithmetic is a facility in which dates can be computed through a specification of various date tags. The resulting date itself can be produced in a variety of formats. Date Arithmetic can be used within ActiveBatch in five areas:

 

  1. As part of a Custom date specification in a Schedule object.

  2. As part of the Parameters property for a Process or Script Job.

  3. When declaring an Active Variable. Date Arithmetic is a type of Active Variable. The variable can then be referenced in objects that support the use of variables.

  4. With a standalone program (Date Arithmetic Substitution Utility), on an execution machine, that can perform Date Arithmetic substitution on an input file and produce a new “substituted” output file.

  5. When used with the Jobs Library function named AbatGetDate.  This function's input parameter uses Date Arithemetic. For example: ${AbatGetDate("<BOW/NEXT>")}.

 

The Date Arithmetic syntax is as follows; you start with a left angle bracket (<) followed by a command and zero or more qualifiers ending with a right angle bracket (>).

 

For example, <TODAY> would yield today’s date.

 

The difference between a command and a qualifier is that a command represents a specific date; for example, TODAY or YESTERDAY represents specific dates. A qualifier is used to perform some type of calculation on a date. For example, <TODAY/-DAY> would mean “today minus 1 day”.

 

What benefits do you get from the Date Arithmetic facility? First, most business applications require the use of dates for generating various reports, aging of database records, etc. The ability to calculate dates, in various formats, can satisfy this requirement. Next, while the Schedule object itself is useful for generating date/time triggers when a pattern is present (i.e. every other Monday, etc) it’s not as easy to use when several non-pattern dates must be entered. This non-pattern date list is easily accomplished with the Date Arithmetic’s calendar facility. You can create a calendar of dates, using the point-and-shoot method and then specify that calendar as part of a Schedule object’s Custom property.