Enform Plus Reference Manual
Clauses
Enform Plus Reference Manual—422684-001
5-43
"JULIAN-DATE Conversion Clause
"JULIAN-DATE Conversion Clause
The JULIAN-DATE Conversion clause allows you to specify translation of a date
target-item into internal format. The syntax for the JULIAN-DATE Conversion
clause is:
year
is the year in 4 digits.
month
is the month in 2 digits, in the range 1-12.
day
is the day in 2 digits, in the range 1-31.
Dates are a common part of database records. From an information standpoint, dates
need to be printed on a report in a form recognizable as a date, such as 05/15/1982,
Apr 1, 1999 or 06-01-2000. From an analytical standpoint, dates need to be stored in a
form for use in calculations or expressions, such as 1999 11 27. Dates used in
calculations or expressions must be in an internal format. If the date is not in this
internal format, it can be converted by using the JULIAN-DATE Conversion clause.
The internal format represents a date as the number of days that have elapsed from an
arbitrary date in the past.
Conversion to Internal Format
To change a date to internal format, use the JULIAN-DATE Conversion clause. For
example, suppose the data description entry of the day and year portion of a data base
date is as follows:
05 date.
10 yy PIC "9999".
10 mm PIC "99".
10 dd PIC "99".
The month (1-12), day (1-31), and year (a 4-digit number) can be passed to the
JULIAN-DATE Conversion clause as follows:
JULIAN-DATE (yyyy, mm, dd)
Gregorian dates must be converted to an internal date format when used for purposes
other than printing on a report. When the date is only to be printed, convert it with the
JULIAN-DATE clause and then use an AS DATE Conversion clause. For example:
JULIAN-DATE (yyyy, mm, dd ) AS DATE *
JULIAN-DATE ( year , month , day )