Previous Topic: Date DifferenceNext Topic: Extract


Date Offset

The date offset function returns the date, in Gregorian format, resulting from adding a specified number of days to a specified date.

Syntax:

►►─── DATEOFF (gregorian-date, offset) ───────────────────────────────────────►◄
[DATEOFFX]

Invocation names:

DATEOFF

Parameters:

gregorian-date

Specifies the date, in Gregorian format, to which the offset is added.

offset

Specifies the offset, in days, that is added to the specified date. Offset can be a numeric variable data field, a numeric literal, a built-in function that returns a numeric value, or an arithmetic expression. Offset can be negative.

Example:

This example determines that date that results from adding four days to January 28, 1958:

compute newdate = dateoff(580128,4)

  NEWDATE = 580201