MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » February 1998

CVTILERPG


  • Subject: CVTILERPG
  • From: Hans Boldt <boldt@xxxxxxxxxx>
  • Date: Mon, 23 Feb 1998 12:44:45 -0500

fixed

Why didn't you use CVTRPGSRC to convert your programs?  It comes
with your ILE RPG compiler.  It may not convert as much of your source
to use the new syntax, but it does make a very good attempt to maintain
the programs semantics.  (And where it can't, it tells you what it hasn't
done so you can address those issues yourself.)

There are 3rd party tools that do more, but may not preserve the
semantics of the program.  As you've noticed, arithmetic in free-form
expressions doesn't work quite the same as the fixed format arithmetic
op-codes.  Overflow handling is one of the reasons.  We decided to
always signal numeric overflow in expressions for several reasons:

1) Since the precisions of intermediate results in expressions are
   determined by the compiler (and may not be immediately obvious),
   overflow may be more likely in a complicated expression.
2) Overflow almost always indicates a logic error in your program.

Of course, to maintain compatibility with old (and presumably working)
programs, we couldn't change the way the old-style arithmetic works.

So, if your conversion tool allows it, just tell it not to convert arithmetic
opcodes to expressions.  (Or try a conversion tool that does allow
you to specify which conversions you want.)

BTW, I'm rather concerned that you count on suppressing numeric
overflow so much.  (99% of the time?!?)  Personally, I can think of very
few uses for truncating high-order digits of a number.  (On the other
hand, I wouldn't mind at all if VISA truncated the high-order digits of
my credit card balance!)

Cheers!  Hans

Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com


---------------------- Forwarded by Hans Boldt/Toronto/IBM on 98-02-23 12:10
---------------------------


owner-midrange-l@midrange.com on 98-02-23 10:03:28
Please respond to MIDRANGE-L@midrange.com @ internet
To: MIDRANGE-L@midrange.com @ internet
cc:
Subject: CVTILERPG


HELP!!!!

I converted a bunch of my RPG400 programs to RPGIV using the cvtilerpg
program.  I have run into a big problem.  It converted all by div
statements to eval statements but free form calculations do not support
arithmetic overflow and 99% of the time this will occur.  We are always
chopping off decimal places, so now I have to go back through all of these
programs and convert all my div statements back to fixed format??!!  Please
let me know if I am not understanding this, but I keep getting a run time
error telling me my result field is not large enough to store the results.

I appreciate any help you can give me.


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






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact