Yes. The variations in EBCDIC and ASCII alone would make for a very
lofty set of comparative routines, let alone the "assumption" of a
non-descript numeric value.
Regarding the Java suggestion (and Peter's C suggestion), my initial
thought was just to have the routine be part of a service program. As
Peter stated, C would probably provide a faster response and require
less overhead, albeit, possibly more code. I *assume* that the JVM
startup process could be limited to the service program, so the first
call would eliminate the lag in future calls, but I could be wrong. I'm
a student of RPG as a second, well maybe fifth, language. :) I
suggested the Java ArrayList class because it already contains methods
for adding, deleting and comparing objects of any Java type, AND because
I am more familiar with Java than C. :)
Regardless of the language, recreating the SQL IN() function in RPG will
provide a challenge to anyone that accepts it. It will be, at the very
least, interesting to read about the creative solutions that are
explored.
Tom Armbruster
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Rory Hewitt
Sent: Monday, March 08, 2010 10:53 AM
To: RPG programming on the IBM i / System i
Subject: Re: AW: More on RPG style
Tom,
Yeah, a challenge indeed. Currently, operational descriptors are only
passed
for character/graphic parameters. IN theory, therefore, I could
*assume*that if no OD is present for a parameter, then it's a numeric
value
(assuming I also specify OPDESC for the procedure). Plus, even if I do
pass
OD's, I won't be able to check for upper-case input etc.
As far as using a Java ArrayList goes, I don't know Java well enough to
implement this myself, but my *guess* would be that it would be much
slower,
what with the JVM startup and stuff.
On Mon, Mar 8, 2010 at 9:50 AM, Tom Armbruster <
tarmbruster@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Rory,
That's an interesting thought. It would be a challenge to account for
all of the variations.
I'm sure I'll be drawn and quartered for suggesting this, but wouldn't
it be easier to use something like a Java ArrayList for this instead
of
trying to reinvent the wheel in RPG? Just a thought. I'm not an
expert
on Java performance in RPG. Maybe it's even worse than embedded SQL.
As an Amazon Associate we earn from qualifying purchases.