Thanks Jon, I tried your first option ( Two Statement ) ,it works fine.

Raj





Jon.Paris@halinfo.it on 01-22-99 12:27:31 PM

Please respond to MIDRANGE-L@midrange.com

To:   MIDRANGE-L@midrange.com
cc:    (bcc: Rajan Srinivasan/Servicing/SuperiorBank)
Subject:  Built in Function ILE RPG




 >> I was looking around for other better methods, because  in RPG/400, it
is
just  one  statement ( multiplying by  10000.01),
You are already using a "better" method !  The multiply by 10000.01 is an
abortion that I'd happily see people flogged for using (not that I have any
strong opinion on the subject!!)
Anyway - I will not tell you that you can still use this horrible approach
in RPG IV (even though you can <grin>) - but I will point out that your
three step approach is overkill.  You only need two:
 C    *USA     Move    NumDateUSA    RealDate
 C    *ISO     Move    RealDate      NumDateISO
RealDate can be in any 4 digit year format (*ISO, *USA, etc. it doesn't
matter)
If you absolutely have to have it in a single statement (don't confuse
number of statements with operational efficiency or clarity of code) the
you can wrap the conversion as a procedure and use it like this.
 C             Eval    NumDateISO = USAtoISO(NumDateISO)
Where USAtoISO looks like this: (not tested and columns are not correct)
 P USAtoISO     B
 D              PI              8  0
 D  NumDateUSA                  8  0
 D RealDate     S                D   DatFmt(*ISO)
 D NumDateISO                   8  0

 C    *USA     Move    NumDateUSA    RealDate
 C    *ISO     Move    RealDate      NumDateISO
 C             Return  NumDateISO
 P              E


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






+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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.