× 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.



I did not read the entire thread, but wouldn't three different sql
statements below accomplish what OP needed?

Assuming that resultFile contains a type field and all fields in file1 &
file2:

// in file1 not in file2
Insert into resultFile
select 'NotInFile2', a.*, b.* from file1 a exception join file2 b on
a.key1=b.key1

// in file2 not in file1
Insert into resultFile
select 'NotInFile1', a.*, b.* from file2 a exception join file1 b on
a.key1=b.key1

// in file2 and file1 but data is different
Insert into resultFile
select 'DataNotMatch', a.*, b.* from file1 a join file2 b on
a.key1=b.key1 where a.field1<>b.field1






-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta
Sent: Wednesday, November 07, 2007 4:16 PM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: Matching Records

Gotta call BS on this one, Adam <grin>. Look at my complete program
compared to what is in effect just the query in SQL. See how many times
I have to define fields or matches. With your UNION and the two JOINs,
there's a whole lot of field enumeration going on, and you still don't
have the code that identifies which records are matching, or found in
only one file. And you still haven't written the report! You still
need to create a cursor or run through a result set and print it, not
exactly negligible.

Sure, we had some giggles trying to remember the exact syntax, but I
basically had the thing right (with the exception of the *IN02) from the
beginning. Compare that to the various issues we had with LEFT
EXCEPTION JOIN vs. RIGHT EXCEPTION JOIN, and I'm still thinking that the
matching records was a lot easier.

Joe


From: Adam Glauser

Wow, looks like matching records really _is_ so much easier than SQL!
:P

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.