I've pretty much stopped following this thread but this last post was germane to the original posters question.
In this last post John Yeung states that one should think of calling a PASE based language, like Python, as akin to calling something on another system. Not at all like the interaction between ILE languages.
If this is true, then I would question the performance.
While you would not have the unreliability of using an external service (as per a recent thread) you might still have the overhead.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of John Yeung
Sent: Wednesday, January 23, 2019 12:40 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Subject: Re: [EXTERNAL] Need help to convert a name in upper case, to mixed case
On Tue, Jan 22, 2019 at 5:11 PM Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
what
helped me considerably was thinking of Python as though it were on a
different system altogether. So whether one ultimately gets Python to
'talk back' via RPC (RFC 1050), Db2, data areas, pipes, message
queues, raw sockets, or a web service, it's really more akin to a
process running on a completely separate machine than it is to a
sub-procedure running on mine.
That's a good way to think of it. Kevin Adler and Calvin Buckley, two of the most expert people you could find on issues revolving around PASE, have pretty much confirmed this on Ryver. PASE might as well be on another machine, for all the technical barriers between it and ILE.
And IBM's Python lives in PASE.
For those who use Java as though it's on the same machine as RPG, and noticed that Java also happens to live in PASE: This is a special case because IBM put special effort into building the Java interface on the i. It's a matter of debate how well that interface works, and in any case that effort is not likely to be duplicated with any other PASE language, because the bang for the buck is just so low. IBM feels there are much more productive ways to use their finite resources.
In summary, Python as an assistant to RPG seems do-able. In the near
future I plan to run 15M rows through the Python proper case converter
to see how the runtime performance is.
I'm interested in the results of that experiment. My initial guess is that the performance will not be very good. But of course, your expectations and needs will determine whether it's "good enough".
Alternatives I considered but abandoned:
1) Re-write the RPG program in Python and do all the work in Python.
Well, technically this is possible. Python reads and writes Db2 just
fine, but the idea of trying to work out all the business rules
secretly stashed away in all those indicators is enough to put me off my feed.
Thank you for at least mentioning this. It shows that the "let Python do everything" idea at least crossed your mind. I think every practical person (which includes me) would agree with you that rewriting that RPG program from scratch is not the best idea.
Certainly not for the near or intermediate term.
Alternatives I'm still considering:
a) Make a new work file in the existing RPG-centric process. Add a new
Python program that reads the work file, and only proper cases the
names. Then fire the existing RPG program. This one has promise, but
I'm running out of 10 character names for scratch files. OK, that was
an exaggeration, but in a CLP that runs a dozen RPG programs, does 5
tagalong sorts and an addrout, do I really want another work file?
Maybe. I'll profile that too when I catch my breath.
I think this is promising too. This doesn't inject Python into the middle of the RPG. Pre- and postprocessing are great uses of Python, with little to no interfacing with ILE needed. If you're running out of QSYS names and you're doing this separate process wholly in Python anyway, you could probably work out some way to do your scratch work in IFS stream files.
b) Abandon the whole idea of proper cased names. Do people really care
that much if the letters they get in the mail are all upper case?
The U.S. Postal Service would certainly be happiest if everything were in all caps.
c) Write an RPG proper case routine. Until a few years ago, this would
have been my default position, my starting point. I have some naive
code that does the bulk of this work already, but the devil's in the
details as always...
I know I've been the main "Python Guy" on these lists for a while now, but I actually have my own RPG name case routines myself. I started them before I discovered I could use Python on the i, but even now I might consider this approach. The performance difference between RPG and iSeriesPython is substantial; I imagine Python on PASE would be much closer in speed to iSeriesPython than to RPG. Also, today there is the benefit of at least one established third-party Python package (that I mentioned earlier in the thread) so in principle, you could mine that package for the relevant logic and reimplement it in RPG (as opposed to having to think of everything yourself from scratch).
John Y.
As an Amazon Associate we earn from qualifying purchases.