Date Arithmetic Substitution Utility

You can evaluate Date Arithmetic expressions using a stand-alone utility named AbatDateSub. It is meant to be used on a source file that contains Date Arithmetic tags and produces an output file with the actual computed dates substituted.

 

AbatDateSub supports all of the Date Arithmetic tags mentioned in Date Arithmetic.

 

The syntax for the AbatDateSub utility is:

 

AbatDateSub input-file-spec output-file-spec [-d date] [-s simulate-date]

 

Where:

 

Input-file-spec is a valid file specification representing an input ASCII file that contains Date Arithmetic tags (if no tags are found the output file will be identical to the source input file).

 

Output-file-spec is a valid file specification representing an output file that will be created. Any Date Arithmetic tags found in the input-file will be substituted in the output file.

 

-d date is an optional parameter. If specified, the format must be DDMMMYYYY. This date will be used to populate the DATE tag. Please note that TODAY will always be the system date and that only the DATE tag is populated with this value. If this value is omitted and the DATE tag specified, the system date is used.

 

-s simulate-date is an optional parameter. If specified, the format must be DDMMMYYYY. This date will be used to represent TODAY in all date tag operations. If omitted, TODAY is populated from the system date. This parameter is useful when you want to test date processing for dates other than the system date.

 

AbatDateSub also supports a Date Substitution file. This ASCII file has the following format:

 

<USER-TAG> <DATE-TAG>

 

User-Tag is a user created tag (that cannot conflict with an existing Date Arithmetic tag) and when found in a source file will cause the Date-Tag contents to be inserted in its place. For example,

 

<CHRISTMAS-DAY> <BOY/+MONTH=11/+DAY=24>

 

means that when the tag <CHRISTMAS-DAY> is found, the resulting Date Arithmetic tags will be used. A Date Substitution file allows you to embed more meaningful and self-descriptive tags for your application. The environment variable ABATDATESUB_ALIAS represents the file specification of the date substitution file.