× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.

This thread ...

Follow-Ups:
Replies:

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

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

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.