× 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.



If you are using ILE, the default is to return a two digit year.  To get a
four digit year you have to supply an extra parameter as follows:-
Accept DateSetup  of ExtData from Date YYYYMMDD

According to the manual for version 4 release 3, OPM cobol returns the date
in a PIC 9(6) format which implies only a 2 digit year.

If I remember correctly from the Y2K issues, any year before 39 was
considered to be next century and any year after was this century.  It also
has something to do with system value QCENTURY

JP




                    "Eric Tubbs"
                    <eatubbs@email.com>       To:     cobol400-l@midrange.com
                    Sent by:                  cc:
                    cobol400-l-admin@mi       Subject:     Re: Date Handling 
Problem
                    drange.com


                    14/08/2002 17:49
                    Please respond to
                    cobol400-l






To all,

JP wrote earlier
> How many digits does the date function return? Which Cobol are you
using OPM or ILE)?

First, I believe the COBOL being used is ILE which is on AS/400 V4R4. But I
pulled this information from the licensing:

V4R4M0      OPM COBOL for AS/400
V4R4M0      *PRV ILE COBOL for AS/400
V4R4M0      Client Encryption 128-bit
V4R4M0      Point-of-Sale Utility for AS/400
V3R6M0      ADTS CS/400
V3R6M0      CODE/400

Second, well hopefully I will answer this question right:

Month returns 2 digits
Day returns 2 digits
Year returns 4 digits (well at least it is being displayed that way, but i
believe the zeros are now being put in the front of it.

This is the output from my QPRINT file as you have already seen:

08/14/0002

Should I pull information from the compile report??


Bruce wrote earlier:

>this returns the date as a two digit year. what you want is accept
today-date from date YYYYMMDD. this will return the 4 digit year, and note
that the format is in ISO sequence.

I have already tried this step, and even trying to use the FUNCTION
CURRENT-DATE or something close to that.

When I attempt to do this:

0140.00            ACCEPT TODAYS-DATE FROM DATE YYYYMMDD.

An error is displayed in the message error saying:

"A period is required before YYYYMMDD. Line rejected."

So I have followed by adding another period, then it asks for a space, and
so on.

Thanks,

Eric

Howard Weatherly, your message wasnt available on the server when I checked
it, but I will check to see if your post did come through later though.


--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

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






**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

postmaster@bif.ie
**********************************************************************



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.