× 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 2/6/2013 1:12 PM, John Yeung wrote:

First, I'd like to thank everyone who responded. It's looking like
SYSCOLUMNS is the preferred way to find out field information in most
circumstances; with direct QADBIFLD access, DSPFFD output file, and
QUSLFLD API potentially useful for special situations.

On Wed, Feb 6, 2013 at 11:54 AM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
I've asked on the iSeries Python forum, but I don't
expect to hear back. (There are not many of us!)

I'll check out that forum.

Has my near-constant Python cheerleading on these lists finally worn
you down, or were you interested in Python on the i anyway? Are you
new to Python or have you used it on other platforms?

I use Python at home for ham radio projects. Simple projects.

Not being an IBM Python-er (yet) I don't know how to package the output
of an API for Python to consume. My very wild guess is to put the API
in an RPG program that creates a result set of the columns and then
Python traverses the result set. Might be a ridiculous idea, who knows?

That's not a ridiculous guess, though I don't think that's what would
typically be done. iSeries Python comes with a module called os400,
which provides an interface for calling arbitrary i programs directly,
including sending and receiving parameters; in principle, anything in
the QSYS.LIB environment of type *PGM is callable this way. I don't
think it's any more difficult to call an API from iSeries Python than
from RPG.

I'm not a Python programmer as much as a Python dabbler. I think Python
on i is on topic for this list so I'll make one more post. I recently
discovered named tuples
http://docs.python.org/2/library/collections.html and it seems that this
is the way to emulate the C structs that various IBM APIs return data
with. It doesn't matter to me that they're immutable, as I'm going to
want to read them, not update them. Traversing the list of columns
returned (QUSLFLD) seems harder to me though. I so want to use
pointers! Not looking for code, just musing aloud. No time to try it
now though :-(

--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.