JULDATE Function

Returns the Julian date from a SAS date value.
Category: Date and Time

Syntax

JULDATE(date)

Required Argument

date
specifies a SAS date value.

Details

A SAS date value is a number that represents the number of days from January 1, 1960 to a specific date. The JULDATE function converts a SAS date value to a Julian date. If date falls within the 100-year span defined by the system option YEARCUTOFF=, the result has three, four, or five digits. In a five digit result, the first two digits represent the year, and the next three digits represent the day of the year (1 to 365, or 1 to 366 for leap years). Because leading zeros are dropped from the result, the year portion of a Julian date might be omitted (for years ending in 00), or it might have only one digit (for years ending 01–09). Otherwise, the result has seven digits: the first four digits represent the year, and the next three digits represent the day of the year. For example, if YEARCUTOFF=1920, JULDATE would return 97001 for January 1, 1997, and return 1878365 for December 31, 1878.

Comparisons

The function JULDATE7 is similar to JULDATE except that JULDATE7 always returns a four digit year. Thus JULDATE7 is year 2000 compliant because it eliminates the need to consider the implications of a two digit year.

Example

The following SAS statements produce these results.
SAS Statement
Result
julian=juldate('31dec99'd);
99365
julian=juldate('01jan2099'd);
2099001

See Also

System Options:
Using the YEARCUTOFF= System Option in SAS Language Reference: Concepts