× 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: doing date arithmetic in CL
  • From: Anton Gombkötö <Gombkoetoe@xxxxxxxxxx>
  • Date: Thu, 13 Jan 2000 23:22:38 +0100

Just a little trick that leaves the solution up to IBM:

To determine whether there is a february 29th, just SUBDUR 1 day from the
1st of march of that year! (in RPG, of course :-)

so you get rid of the weird calculations, and IBM might implement whatever
the world decides and you (your customers) load it via PTF and will be happy
till the end of days(!)...  :-)
If you're lucky, you do not even need to recompile the program, when such
things happen...

Just
0.02 Euro

Anton Gombkötö

----- Original Message -----
From: "Joel Fritz" <JFritz@sharperimage.com>
To: <RPG400-L@midrange.com>
Sent: Saturday, January 08, 2000 12:47 AM
Subject: RE: doing date arithmetic in CL


> Leap year is a year divisible by 4 except when divisible by 100 unless it
is
> divisible by 400.  E.g. 2000 is a leap year, but 1900 is not.  I'm sure
you
> have a good reason for doing it in CL, but if it were up to me I'd do it
in
> RPG.
>
> -----------------------------------------------------------------
>    A mind is a terrible thing to use.
>
> Joel Fritz
>
>
> -----Original Message-----
> From: Naser Vassef [mailto:Naser_Vassef@orcom.com]
> Sent: Friday, January 07, 2000 3:09 PM
> To: RPG400-L@midrange.com
> Subject: RE: doing date arithmetic in CL
>
>
> I'm coding a CL to ensure the last day of a month is written to &DAY field
> by looking at the MONTH value and set to either 31, 30 or 28. How will I
> calculate the Leap years? ( Feb 29)
> I did condition up to the year 2020, is there a better way in CL without
> having to call a RPG program.
> Thanks
> +---
> | 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 ...

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.