The date change functions return the conversion of a specified date from one format (Gregorian, calendar, European, or Julian) to another.
Syntax:
►►─┬─ DATECHG (date, 'input-date-format', 'output-date-format') ─┬────────────►◄ └─┬─ GCDATE ─┬─ (date) ───────────────────────────────────────┘ ├─ GEDATE ─┤ ├─ GJDATE ─┤ ├─ CGDATE ─┤ ├─ CEDATE ─┤ ├─ CJDATE ─┤ ├─ EGDATE ─┤ ├─ ECDATE ─┤ ├─ EJDATE ─┤ ├─ JGDATE ─┤ ├─ JCDATE ─┤ └─ JEDATE ─┘ ►►─┬─ DATECHGX (century-date, 'input-date-format', 'output-date-format') ─┬───►◄ └─┬─ GCDATEX ─┬─ (century-date) ───────────────────────────────────────┘ ├─ GEDATEX ─┤ ├─ GJDATEX ─┤ ├─ CGDATEX ─┤ ├─ CEDATEX ─┤ ├─ CJDATEX ─┤ ├─ EGDATEX ─┤ ├─ ECDATEX ─┤ ├─ EJDATEX ─┤ ├─ JGDATEX ─┤ ├─ JCDATEX ─┤ └─ JEDATEX ─┘
Invocation names:
DATECHG DATECHGX
GCDATE CGDATE EGDATE JGDATE GCDATEX CGDATEX EGDATEX JGDATEX
GEDATE CEDATE ECDATE JCDATE GEDATEX CEDATEX ECDATEX JCDATEX
GJDATE CJDATE EJDATE JEDATE GJDATEX CJDATEX EJDATEX JEDATEX
Parameters:
Specifies the six-byte object date for the date change function.
Date can be:
Specifies the eight-byte object date (containing the century) for the date change function.
Century date can be:
Specifies the format of the date specified by date or century-date.
Input date can be:
Specifies the format to which date or century-date is to be converted.
Output date can be:
Examples:
Example 1
In this example, the date change function is used to convert January 28, 1958, from Gregorian to calendar format:
compute calendar = datechg(580128,'g','c') group by all 012858
Example 2
In this example, the date change function is used to convert November 12, 1991, from Julian to Gregorian format. The returned date contains the century portion of the year:
compute calendar = jgdate(91316,'j','g') 911112
Example 3
In this example, the date change function is used to convert January 28, 1958, from Gregorian to calendar format. The returned date contains the century portion of the year:
compute calendar = datechgx(19580128,'g','c') group by all 01281958
|
Copyright © 2013 CA.
All rights reserved.
|
|