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



Because hundreds of programs were non-Y2K compliant, and they were wriiten
in RPG III. At the time, management did not want to convert them all to RPG
IV. Just as well; having common date routines ensured that date calculations
were consistent across all areas of the application.

On Tue, Apr 1, 2008 at 10:33 AM, Lim Hock-Chai <
Lim.Hock-Chai@xxxxxxxxxxxxxxx> wrote:

Just curious on the purpose of creating your own date routine?

We also have one in our system and I've never use it (A lot of
developers here uses it though). Look at the parms and you will know
why I never use it:
DATECODE A 10 1 10 Date Transaction Code
CENTURY1 S 2 0 11 12 Date 1 Century
YEAR1 S 2 0 13 14 Date 1 Year
MONTH1 S 2 0 15 16 Date 1 Month
DAY1 S 2 0 17 18 Date 1 Day
JUL100YR1 S 5 0 19 23 Date 1 Julian or 100 Year
FORMAT1 A 4 24 27 Date 1 Format
CENTURY2 S 2 0 28 29 Date 2 Century
YEAR2 S 2 0 30 31 Date 2 Year
MONTH2 S 2 0 32 33 Date 2 Month
DAY2 S 2 0 34 35 Date 2 Day
JUL100YR2 S 5 0 36 40 Date 2 Julian or 100 Year
FORMAT2 A 4 41 44 Date 2 Format
DAYOFWEEK S 1 0 45 45 Numeric Day of the Week

SIGNDIFF A 1 46 46 Difference Sign Value
(+,-,' '
YEARDIFF S 7 0 47 53 Difference in Years

MONTHDIFF S 7 0 54 60 Difference in Months

DAYDIFF S 7 0 61 67 Difference in Days

DATEERROR A 7 68 74 Error Return

CLOSEPGM A 1 75 75 Close Program Flag


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Francis Lapeyre
Sent: Tuesday, April 01, 2008 8:20 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Classic Traps -- I need your input!

<clip>

Anyway, the old routines were using Julian dates (ouch!), and did not
account for leap year at all (Feb. 29 simply did not exist). I came up
with four or five callable programs written in RPG IV that did all the
date calcs. All of them are still in use today (we also have a service
program version of them for use in "true ILE" programs).

</clip>
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-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.