× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Also, dspsysval qdatfmt shows our date format to be MDY

TomH

-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tom Hightower
Sent: Friday, November 29, 2013 1:01 PM
To: 'COBOL Programming on the IBM i (AS/400 and iSeries)'
Subject: Re: [COBOL400-L] *ISO date in COBOL?

From the compile listing:

FD EVENTS-IN.
01 MCEVNT-RECORD.
COPY DDSR-JE027006 OF EVENTS.
I-O FORMAT:JE027006 FROM FILE JE027006 OF LIBR
Case party action.Fetch by Case-BegDt-BegTm
THE KEY DEFINITIONS FOR RECORD FORMAT JE027006
NUMBER NAME RETRIEVAL ALTSEQ
0001 CT1FYA ASCENDING YES
0002 JEBOA ASCENDING YES
0003 BEGIN-DATE DESCENDING NO
0004 JELLA DESCENDING NO
05 JE027006.
06 JEBOA PIC X(20).
06 CT1FYA PIC X(5).
06 CP-SEQ-NBR PIC S9(7) COMP-3.
06 CPA-SEQNBR PIC S9(7) COMP-3.
06 JE9AA PIC S9(7) COMP-3.
06 JEPVA PIC X(1).
06 BEGIN-DATE FORMAT DATE "@Y-%m-%d".
(Date field)


-----Original Message-----
From: cobol400-l-bounces@xxxxxxxxxxxx
[mailto:cobol400-l-bounces@xxxxxxxxxxxx] On Behalf Of
MichaelQuigley@xxxxxxxxxx
Sent: Friday, November 29, 2013 12:47 PM
To: cobol400-l@xxxxxxxxxxxx
Subject: Re: [COBOL400-L] *ISO date in COBOL?

Check the compile listing to see if the field is being specified as FORMAT
DATE '@Y-%m-%d'. There could also be an entry under special names which
could throw things off. If the format isn't specified with '@Y-%m-%d', the
compiler will treat the dates using the job default--and you cannot set
DATFMT for a job to *ISO (or *USA for that matter).

You may know this, but internally the dates are not stored in a format we
humans would recognize. They are stored as a 10-digit integer. The system
takes care of converting to whatever format is requested at the time. If
you don't specify one, It will default the the job format. At our shop
that's *MDY--perhaps yours is *YMD. In any case, none of the default job
date formats include the 1st of January 0001. Hence, dates as early as that
will cause a data format mapping error.

If the compile listing shows the year portion of the date as something other
than '%y' (lower-case y), then you've got a different problem. an
upper-case Y with either % or @ will work.

cobol400-l-bounces@xxxxxxxxxxxx wrote on 11/28/2013 01:00:03 PM:
----- Message from "Tom Hightower" <tomh@xxxxxxxxxxx> on Wed, 27 Nov
2013 17:55:18 -0600 -----

To:

"'COBOL Programming on the IBM i \(AS/400 and iSeries\)'" <cobol400-
l@xxxxxxxxxxxx>

Subject:

Re: [COBOL400-L] *ISO date in COBOL?

The programmer working on it says that she's doing the compile like so:

CRTBNDCBL PGM(IDOCKETGY/CCEXTRACT) +
SRCFILE(IDOCKETGY/QCBLSRC) SRCMBR(*PGM) +
OPTION(*SOURCE) CVTOPT(*DATETIME *DATE) +
DBGVIEW(*ALL)

TomH

--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L)
mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/cobol400-l.

--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L)
mailing list To post a message email: COBOL400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/cobol400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.