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



Exactly - _RFILE is returned by _Ropen and has pointers to input and output buffers, various NULL maps, IO feedback area, etc. All this would be placed into a data structure and then passed by whatever means available. Some of that stuff might be available to the RPG program - I forget whether we can get at the buffers directly. We CAN get to the feedback area.

One big problem - there are no /copy members in QYSINC for these things. So we'd have to build our own - as many do already for other APIs. These will probably not change much - but one should check member RECIO in QSYSINC/H to see what's there.

Of course, you can't open a file in RPG using both F-specs and these _R* functions. As you said, file-agnostic won't be able to use F-specs, unless you don't care about modern elements like NULL-capability, which is more and more prevalent as we use CREATE TABLE more and more.

Julian Moneypenny some years ago had utilities for file-agnostic processing, using an internally-defined file - this has the big problem of not handling these new elements I mention above.

Too much fun on a Saturday!!

Vern

At 10:47 AM 11/24/2007, you wrote:

> From: Vernon Hamberg
>
> He wants to pass some kind of reference to an opened file to another
> program - then work with it - this reference is available in C

What he wants is to be able to pass a file handle. We don't have file
handles in RPG (today) and that makes it tough.

> My recommendation is to write what he wants in an ILE C module and
> bind it into his app with procedure calls from ILE RPG.

Yup, this is the ticket. It's been forever since I tried to write an ILE C
file procedure, but it's not black magic for someone with C experience. You
could write a wrapper procedure for the open procedure and return the file
pointer, and then pass that back to your process and close procedures.

He doesn't get to use the RPG syntax, of course, which I think is the issue.
I think James wants to be able to write file-agnostic RPG syntax, an
admirable goal. As Paul points out, the closest you can get via RPG is if
the files have the same external format. Otherwise it's embedded SQL.

Joe

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


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.