× 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.



Aaron,

I am not sure you understood my previous post, based on what you chose
to quote, and how you responded.

I wrote:

There is no easy way for an ILE program (or really any non-Python program)
to receive information directly from Python code, in the form of return
values or parameters.

You responded:

Take a look into XMLSERVICE on the YiPs website**. Tony Cairns (IBM'er)
has created a Ruby gem/client*** making it simple to communicate with an
RPG program (including return values, parms, and stateful jobs).

Your response has nothing to do with my quote, so I'm not sure why you
quoted me at all.

I took a look at XMLSERVICE. From what I can gather, it's a package
which can expose RPG-implemented functionality to just about anything
which chooses to follow its protocol.

So this service could also be called from Python. Meaning there is no
advantage to Ruby over Python in this regard.

The part of my message which you chose to ignore is this:

iSeriesPython includes an easy-to-use wrapper to call any
native *PGM object, including passing parameters to it and
retrieving parameter values from it. So, you have "bidirectional"
communication, as long as Python is doing the calling.

Maybe that part was not clear. So here is some Python code:

from os400 import Program
x = Program('MYRPGPGM', '*LIBL', (('c', 20), ('d', 5, 0)))
x('Input text', 7)
result1 = x[0]
result2 = x[1]

The above assumes I have a *PGM object called MYRPGPGM. (It could be
implemented in anything that compiles to *PGM objects.) MYRPGPGM has
two parameters, a 20-character string and a 5-digit packed decimal.

I call it, passing in 'Input text' as the first parameter and 7 as the
second parameter. I then receive output from the first parameter in
result1 (which will still be 'Input text' if MYRPGPGM doesn't do
anything to it) and output from the second parameter in result2 (which
will still be 7 if MYRPGPGM doesn't do anything to it).

So, there's no need for any additional package if all you want to do
is call a *PGM. Just import os400.Program and you're good to go.

Does PowerRuby have this? Maybe it does, maybe it doesn't. You
didn't mention anything like it, though.

Then at the end you say:

Going the other direction (RPG initiating the call to <insert script
language>) isn't as seamless.

So, once again, there is no advantage for Ruby (or any other scripting
language) over Python.

Perhaps I've missed your point. XMLSERVICE is a cool project, but I
don't see how it's relevant.

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.