• Subject: Sv: Programming Performance
  • From: "Henrik Krebs" <Henrik.Krebs@xxxxxxxxx>
  • Date: Wed, 27 May 1998 21:38:44 +0200

Erick <egarske@cts.com> wrote on 26. maj 1998 at 19:43

>Recently, I read an article that suggested that using a return in an RPG
>program would improve system performance simply by staying resident in
>memory during the job stream. 

>If this is the case, would all the data areas and work variables have to
>be reinitialized?

First you should understand the RPG-logic. RPG still runs that old cycle -
repeating the C-specs until *INRT or *INLR is *ON, or till it meets the RETRN
opcode. The important thing is if *INLR is *ON or not when leaving the program
- If *OFF any record locks for update will persist and RPG-fields left with
their present value. If it was *ON, then the next call will have to open files
again, do all the I=Initialize for the DS's and execute the *INZSR if it exist.

Don't care about opening a program two or four times in a job. It's not THAT
hard. But hundreds of times?

Remember, that it is easy in a INIT-procedure to do CLEAR or RESET on DS's and
record formats. Also it is a bad programming habbit to rely on 'this variable
is never used before'. YOU ar the one responsebly for the content of the
variable. Some programmer may later do some changes in the program (using a
variable prior to your code), beeing un-aware that you rely on the fact, that
the variable is not used before. So Initialize any variable, no matter what.



Regards

Henrik Krebs

------------------------------------------------------------
Henrik Krebs
IT Consultant (IBM AS/400)
Phone +45 31 57 83 23
Mobile +45 40 88 83 23
Email: Henrik.Krebs@Scout.Net
Web: http://users.cybercity.dk/~dko3534
Snailmail: Amagerbrogade 62, 3-24, DK-2300 Copenhagen
------------------------------------------------------------
+---
| 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 thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].