|
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 mailing list archive is Copyright 1997-2025 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.