|
This should certainly be doable with either the SQL CLI APIs or with the ILE C _Ropen(), _Rreadn(), etc APIs.
Personally, I find the ILE C APIs quite easy to use -- just as easy as a program described file in traditional RPG once you learn how. They have advantages over the program described files, though... the null map is one. The ability to have the same file open many times, but referenced by a separate file handle is another. The ability to access the file randomly by key -- even if the format of the file isn't known at compile time -- is yet another.
The SQL CLI APIs are another interesting way to solve the problem. They do a little more of the work for you (such as interpreting fields in an external definition, converting them to your internal RPG types, etc) but probably don't perform as well...? Of course, they make it possible to include CLOBs and DBCLOBs in your CSV output if you like.
As an Amazon Associate we earn from qualifying purchases.
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.