× 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: Searsdon@xxxxxxx
  • Date: Fri, 7 Jan 2000 15:03:10 EST

I Think this example should help you:
the basic idea was to change a date to a julian date, decrement by a week and 
then convert baack to a standard date. I've been doing simple cl math scince 
the 80's this way.

             DCL        VAR(&DATE) TYPE(*DEC ) LEN(8 0)
             DCL        VAR(&CDATE) TYPE(*CHAR) LEN(6)
             DCL        VAR(&CENDATE) TYPE(*CHAR) LEN(8 )
             DCL        VAR(&JULDATE) TYPE(*CHAR) LEN(5 ) START:      
RTVSYSVAL  SYSVAL(QDATE) RTNVAR(&CDATE)
             CVTDAT     DATE(&CDATE) TOVAR(&JULDATE) FROMFMT(*MDY) +
                          TOFMT(*JUL) TOSEP(*NONE)
             CHGVAR     VAR(&DATE) VALUE(&JULDATE)
             CHGVAR     VAR(&DATE) VALUE(&DATE - 7)
             CHGVAR     VAR(&JULDATE) VALUE(&DATE)
             CVTDAT     DATE(&JULDATE) TOVAR(&CENDATE) FROMFMT(*JUL) +
                          TOFMT(*YYMD) TOSEP(*NONE)
 

Don Sears
<A HREF="http://anthillrep.bizland.com/seti.htm">Join the Search for 
Extraterrestial Life at Home Program</A>
http://anthillrep.bizland.com/seti.htm 

Make Money Surfing the Internet
www.getpaid4.com
reference number: searsdon
+---
| 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.