|
On Fri, 2003-09-12 at 08:28, Peter Colpaert wrote: > Hi group, > > I'm trying to make a general purpose utility which will copy any PF into an > XLS file in the IFS (using some java class behind the screens). When it's > finished, I will probably make it available to the public on my new website > (yet to be developed). > > In order to determine the field types (alpha or numeric) for the XLS, I see > three possibilities: > > * Using the QUSLFLD API to a user space, and loop through that for every > record > * Doing a DSPFFD into an outfile in QTEMP and loop through that for every > record > * Using the QUSLFLD API, read it once, write the fieldname and data type to > a workfile in QTEMP, and loop through that for every record > > Considering that the files can be rather large (I think I will make the > program automatically create a new sheet when the row counter reaches 65000 > or whatever the limit in Excel is), performance may be an issue. Hi Peter I'm not sure which method is fastest, but I've written a similar routine. In my .csv creation program, CRTCSVDTA[1], I put the QUSLFLD output into an array (mapped over a data structure) once at the start of the program, then loop through the array for each record of the file being converted. In my case the overall process isn't that fast, as I put the .csv output into a DB2/400 file first then use CPYTOIMPF to get the stream file (I've not got into writing IFS files direct yet). The processing of the record data seems to be pretty quick though - but you must use VARYING length fields or it's really slow ;) Regards, Martin [1] http://www.dbg400.net/crtcsv.html - see the code in DBG201R4 in the download package. -- martin@xxxxxxxxxx AIM/Gaim: DBG400dotNet http://www.dbg400.net /"\ DBG/400 - DataBase Generation utilities - AS/400 / iSeries Open \ / Source free test environment tools and others (file/spool/misc) X [this space for hire] ASCII Ribbon Campaign against HTML mail & news / \
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.