DATE EDIT CODE CONTROL SUMMARY


Table 2.26 lists various examples of how the header specification affects the date edit code (Y). The date edit code is, ironically, not used to edit fields that are type date, but rather to edit fields that are type numeric. The edited numeric output field is written in a date-formatted presentation.

Table 2.26: Controlling the Y ( DATE) Edit Code

Date Variable[1]

DATSEP Keyword

Date Edit Keyword ( DATEDIT) Header Specification

Not Specified

*MDY

*DMY

*YMD

UDATE

Blank

6/21/88

6/21/88

21/06/88

88/06/21

UDATE

Blank

21/06/88

6/21/88

21/06/88

88/06/21

UDATE

Blank

21.06.88

6.21.88

21.06.88

88.06.21

UDATE

-

6-21-88

6-21-88

21-06-88

88-06-21

UDATE

-

21-06-88

6-21-88

21-06-88

88-06-21

UDATE

-

21-06-88

6-21-88

21-06-88

88-06-21

*DATE

Blank

6/21/1988

6/21/1988

21/06/1988

1988/06/21

*DATE

/

21/06/1988

6/21/1988

21/06/1988

1988/06/21

*DATE

.

21.06.1988

6.21.1988

21.06.1988

1988.06.21

*DATE

-

6-21-1988

6-21-1988

21-06-1988

1988-06-21

*DATE

-

21-06-1988

6-21-1988

21-06-1988

1988-06-21

*DATE

-

21-06-1988

6-21-1988

21-06-1988

1988-06-21

[1]The UDATE field is a six-position numeric field with zero decimal positions. The * DATE field is an eight-position numeric field with zero decimal positions.

The date 21 June, 1988 (or June 21, 1988, for those who live in the USA) is the basis for the examples used in Table 2.26.

Tip

To avoid zero suppression of the leading zero with the UDATE or *DATE values (e.g., to output the date as 06/21/88 instead of 6/21/88), use a 7- or 9-position numeric field for output instead of UDATE or *DATE. The Y edit code, by definition, "zero suppresses" only the first zero in the output field. Moving UDATE or *DATE to a larger field avoids zero suppression of the leading digit in the date.




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net