
JULIAN-DATE Conversion Clause
Clauses
5–44
058057 Tandem Computers Incorporated
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:
JULIAN-DATE (
year , month , day )
year
is the year in 4 digits.
month
is the month in 2 digits, 1-12.
day
is the day in 2 digits, 1-31.
Dates are a common part of data base records. From an information standpoint, dates
need to be printed on a report in a form recognizable as a date, such as 05/15/72, Apr
1, 1979 or 06-01-1970. From an analytical standpoint, dates need to be stored in a form
for use in calculations or expressions, such as 80 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 which 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, assume the data description entry of the day and year portion of a data base
date is as follows:
05 date.
10 yy PIC "99".
10 mm PIC "99".
10 dd PIC "99".
The month (1-12), day (1-31), and year (4 digit number) can be passed to the JULIAN-
DATE Conversion clause as follows:
JULIAN-DATE ((1900 + yy), mm, dd)
Notice the numeric literal 1900 was added to make a 4 digit year.
Gregorian dates must be converted to an internal date format when used for purposes
other than printing on a report. When the date only needs to be printed, convert it
with the JULIAN-DATE clause and then use an AS DATE Conversion clause. For
example:
JULIAN-DATE ((1900 + yy), mm, dd ) AS DATE *
Содержание ENFORM 058057
Страница 5: ...New and Changed Information iv 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 6: ...New and Changed Information 058057 Tandem Computers Incorporated v...
Страница 18: ...Preface xvi 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 19: ...Preface 058057 Tandem Computers Incorporated xvii...
Страница 21: ...Notation Conventions xviii 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 25: ...ENFORM Terminology Introduction 1 4 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 121: ...TITLE Statement Statements 4 50 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 227: ...ENFORM Procedures ENFORM Syntax Summary A 16 058057 Tandem Computers Incorporated This page left intentionally blank...
Страница 269: ...Glossary Glossary 4 058057 Tandem Computers Incorporated This page left intentionally blank...