×
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.
First thing I did was to second the RFE Barabara referred to - I hope
millions of RPG-ers will do the same.
Some background:
1. The file containing the data to be split is a kind of "|" separated EDI
file having
several record types
(Header record, many line records (2 kind of) and a Trailer record)
2. The file is uploaded to the i by a home grown Web Java utility for file
imports
of many kinds(fixed,separated text, Excel).
This utility run on a Wintel server , loads files to a DB file on the
i and invokes a
program on the i to process it by calling a Stored Procedure .
there is a QZDASOINIT job seviceing it of course.
3. I need to parse each kind and move it to it's own PF.
4. I have started out with SQL and used a UDF called ELEMENT that lets me
retrieve
Element N of the string, so my SQL looks like insert into DTL_File
select ELEMENT(3, Recordtext, '|') as Customer, ELEMENT(4, Recordtext,
'|') as
SKU_ITEM , ELEMENT(5, Recordtext, '|') as QTY
where ELEMENT(1, Recordtext, '|')= 'CD" etc.
4. This is a somewhat primitive way but it suits my simple mind.
5. in this case the stored procedure calls a CLLE PGM that executes 3
RUNSQLs
with COMMIT(*NONE) to process 3 kind of records.
5. problem is (are)
a. there are ill formatted records in the file that "bombs" the SQL
so one such faulty record causes the entire set to be lost.
b. it looks as if the Inserts are Not Committed even when there are no
errors.
6. HENCE RPGLE %split function
Thanks for reading this looong story
Gad
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.