|
Rich, Rather than do everything dynamically in this program have the program generate RPGLE, SQLRPGLE or SQL source code to do the actual conversion. Your main RPG program writes and then compiles a specific RPG program to do the actual conversion. The generated code wouldn't have to work through arrays and would be faster. If you generate RPGLE code you could avoid using SQL entirely. Or you could go the other way and have your main RPG program write and then run SQL source. In this setup your date conversion routine would be a SQL user defined function executed by the generated SQL source. You could get away from having to process the SQL a record at a time in your main program. One INSERT statement for the file header record (or maybe the main RPG program writes this record directly). Another INSERT statement for the field/column names record (or maybe the main RPG program could continue to write this record directly). Then a third INSERT using SELECT for the remainder of the file: INSERT INTO FTPOUTPUT ( FTPFIELD ) SELECT RTRIM( TEXT) || ',' || MYDATE(DATE) || ',' || CHAR(NUMBER) [etc] FROM INFILE Paul
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.