An echo of one of my own from way back?
What a sensible notion. My guess is there is some ego driven desire always using a *SRVPGM is cleverer than the old way.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, 10 February 2010 6:39 a.m.
To: RPG programming on the IBM i / System i
Subject: Re: Program or Procedure
Hello Ronald,
I have to come up with a process to generate invoice numbers, using both
numeric and alpha characters. I am trying to decide whether to create a
program or procedure to housed the algorithm. In general, which run
faster, an ILE program or a procedure?
Does performance really matter?! How many times per second will you be
calling this routine? Please don't count calls in separate jobs... only
count calls within a given job. How many times per second do you expect
this to be called?
If it's less frequently than 5 times per second, it doesn't matter
whether you use a program or a procedure. Even on a very slow machine,
the performance difference will be a non-issue for you.
And in my shop, we don't generate invoice numbers rapidly in a loop.
There's no doubt that a procedure will outperform a program. No
question at all. But you really should do what makes the most sense for
your environment... what will be easiest to maintain, what will be
easiest to reuse from all of your programs, what will be easiest to
refactor if refactoring is ever necessary.
Unless your environment is extremely different from mine, program vs.
procedure performance should be a non-issue.
As an Amazon Associate we earn from qualifying purchases.