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


  • Subject: RE: Date Conversion Problem
  • From: "Venkat Sreenivasan" <vsreeniv@xxxxxxxx>
  • Date: Mon, 23 Aug 1999 10:34:20 -0400



Thank you guys for your help.  I changed to *ISO instead of *CYMD it worked.
Thank you for enlightening me on this issue.
I was always under assumption that I should use *CYMD, *MDY, *YMD or *DMY when
the variable was not a date variable.
I have learned something new today.

Venkat Sreenivasan





Buck Calabro <mcalabro@commsoft.net> on 08/20/99 07:53:10 PM

Please respond to RPG400-L@midrange.com

To:   "'RPG400-L@midrange.com'" <RPG400-L@midrange.com>
cc:    (bcc: Venkat Sreenivasan/IT/MIA/RCL)

Subject:  RE: Date Conversion Problem




The RPG IV manual says that *CYMD is a 3 digit date format: CYYMMDD.  The
"C" part is a century designator.  Your first MOVE would use 8980101 as the
*CYMD.  Century designator 8 = 2700-2799, so your date would be interpreted
as 2798-01-01, just as you show.

I believe that your factor 1 should be *ISO instead of *CYMD.  Check the RPG
manual reference on date formats for specifics:
http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/QB3AGZ01/2.3.4

Here is a link to the RPG IV reference manual in general:
http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/BOOKS/QB3AGZ01/CCONTENTS

Buck Calabro

> -----Original Message-----
> From:   Venkat Sreenivasan
> Sent:   Friday, August 20, 1999 11:52 AM
> To:     RPG400-L@midrange.com
> Subject:     Date Conversion Problem
>
>
>
> Hi All
>
> I encountered a strange situation when I ran the following program for
> testing
> the logic.  I do not know whether I understood it wrong or that is how the
> IBM
> date routine works.  Need help.
>
> Source Code:
>
> 12       d date             s               d   datfmt(*USA)
> 14       d date1           s              8  0 inz(18980101)
> 22       c     *CYMD         move      date1         date
> 1.   In the above code when I checked the value of DATE after executing
> line 22
> it reads like: 01/01/2798 which is wrong.
>
> I would like to know is there anything wrong with the method I've adopted.
> DATE1 is the date that stored in our files and DATE2 is the newly
> calculated
> date which will be updated to another field.   Your help is verymuch
> appreciated.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---






+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.