|
<<SNIP>>
At any rate, here is an updated version that should work for you in
SQL and will also only give you the fields you are wanting (no RRN
field):
SELECT field1,field2,field3
FROM ( SELECT RRN(b) AS RRN
,b.*
FROM file1 AS b
UNION
SELECT RRN(b)+(SELECT max(RRN(a)) FROM file1 AS a) AS RRN
, b.*
FROM file2 AS b
) tbl
ORDER BY RRN asc
You will notice this will push the file2 data to the end because it
will start with the last RRN from file1. Then we encapsulate that in
another SQL statement so you can just get everything except the RRN
column.
SQL is the right tool for the job here IMHO.
Everything you can do in RPG you can also do in SQL, I have not yet
found anything that breaks that theory.
Very much the opposite, I found I can do way more in SQL then I can
do in RPG.
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.