This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I’m using date data types in display files.  The default format is *ISO; the
dates displayed as “0001-01-01”.

Subsequently I added DATFMT(*USA) MAPVAL((‘01/01/0001’ *BLANK)) to the
display file and recompiled it successfully.

Even after recompiling the display file, it continued to show ‘0001-01-01’.
Entering a date as ‘2001-12-31’ gave me a reason code 8 error (and you can’t
F1 on the message…what’s up with this?).  Entering a date of 12-31-2001 was
accepted by the display file but the program barfed with a “Date, Time or
Timestamp value is not valid” error.  [Note to technical writers: it should
be “Date, time, or timestamp value is not valid”.]  I signed off and signed
on again, still no joy.  After I recompiled the ILE RPG program, everything
(including the date formatting) worked properly.  There were no duplicate
DSPF or RPGLE objects floating around.

The language in the DDS/DSPF reference is manual is confusing (see below),
especially in the context of the operation of edit codes, edit words, and
display file attributes.  What appeared to be a cosmetic change to a display
file is not, and no level check was signaled.  The formatting of date and
time data types is program-dependent and not “external” to the application
program.

>From the DSPF reference manual:

If you do not specify the DATFMT keyword, the default is *ISO.

If you specify *JOB, the high level language and the application handle the
format as *ISO. On output the
system converts the format to the format specified by the Date Format Job
Definition Attribute. On input,
the system converts the format to *ISO before it passes control to the
application.

<SNIP>

It is the responsibility of the high-level language and the application to
format the date field according to
the format specified on the DATFMT keyword and use the separators specified
on the DATSEP keyword.
The system does not format fields on output. The system validates the date
field (L data type) on input
according to the format the DATFMT keyword specifies and the separator that
the DATSEP keyword
specifies.

--



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.