JULDATE Function

Returns the Julian date from a SAS date value.

Category: Date and Time
Returned data type: DOUBLE

Syntax

JULDATE(date)

Arguments

date

specifies any valid expression that represents a SAS date value.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

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). As leading zeros are dropped from the result, the year portion of a Julian date can be omitted (for years ending in 00) or it can 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 years that end between 00–09, you can format the five-digit Julian date by using the Z5. format.
For more information about how FedSQL handles dates, see Dates and Times in FedSQL.

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 statements illustrate the JULDATE function:
Statements
Results
select juldate(mdy(12,31,2013));
7365
select put(juldate(mdy(12,31,2013)),z5.);
07365
select juldate(mdy(9,1,1999));
99244
select juldate(mdy(7,1,1886));
1886182

See Also

Last updated: February 23, 2017