Previous Topic

Next Topic

Book Contents

Book Index

%%$CALCDTE

The %%$CALCDTE function performs date manipulation by adding or subtracting a specified number of days from a specified date.

Note: This function replaces the old %%CALCDATE function, which is still supported for backward compatibility. BMC recommends that you use the %%$CALCDTE function rather than the %%CALCDATE function, to take advantage of its increased versatility.

The format of the %%$CALCDTE function is:

%%$CALCDTE date ± [quantity_type]quantity

where:

Valid values are:

If no value is specified, the default value is D (days).

Note: In setting values for the quantity_type and quantity variables, ensure that the final date is not later than the year 2054.

Example 1

//* %%SET %%A=%%$CALCDTE %%$ODATE -1

If the original scheduling date is February 1, 2001, %%A is assigned a value of 20010131.

Example 2

//* %%SET %%A=%%$CALCDTE %%$ODATE +M1

If the original scheduling date is January 30, 2002, %%A is assigned a value of 20020228.

Example 3

//* %%SET %%A=%%$CALCDTE %%$ODATE +Y1

If the original scheduling date is February 29, 2000, %%A is assigned a value of 20010228.

Note: If as a result of adding months to a date, the number of days exceeds the maximum number of days possible in the resulting month, Control-M reduces the number of days to the actual maximum.

Parent Topic

Functions