Julian-Date Conversion Clause; Conversion To Internal Format - Tandem ENFORM 058057 Reference Manual

Data management library
Table of Contents

Advertisement

Clauses

JULIAN-DATE Conversion Clause

JULIAN-DATE
Conversion Clause
Conversion to Internal
Format
5–44
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.
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
10
mm
10
dd
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 *
058057 Tandem Computers Incorporated
PIC "99".
PIC "99".
PIC "99".

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enform

Table of Contents