Previous Topic: Selection Parameters for Date Built-In Functions

Next Topic: Example

Date Increment

The *DATE INCREMENT built-in function lets you add a quantity to a given date. You specify the kind of quantity to add using the *Duration type parameter. Note that you should check the return code set by this function in order to catch any errors encountered. This function is the converse of the *DURATION function.

The *DATE INCREMENT built-in function performs the operation:

*Date1 = *Date2 + *Duration

There are eight parameters for this function type:

For more information on the selection input parameters briefly described here, see the Selection Parameters for Date Built-In Functions topic in the *DATE DETAILS built-in function description.

The possible values for *Duration type and the effect each has on the meaning of the *Duration parameter are shown in the following table.

*Duration Type Values

Effect on the *Duration Parameter

*DAYS

Number of selected days to add to the specified date (*Date2). This is the default.

*MONTHS

Number of full months to add to the specified date (*Date2). Partial months are ignored.

*YEARS

Number of full years to add to the specified date (*Date2). Partial years are ignored.

*YYMM

Number of years and full months in YYMM format to add to the specified date (*Date2); partial months are ignored. For example, 1011 means 10 years and 11 months; 1100 means exactly 11 years.

*YYMMDD

Number of years, months, and days in YYMMDD format to add to the specified date (*Date2). For example, 100923 means 10 years, 9 months, and 23 days; 110000 means exactly 11 years.