View previous topic :: View next topic
|
Author |
Message |
krunalbafna Warnings : 1 Active User
Joined: 18 Jan 2010 Posts: 143 Location: Pune
|
|
|
|
I am using following statment
Code: |
JOB INPUT (FILE1 KEY(A1, A2, A3, A4, A5) +
FILE2 KEY(AA1, AA2, AA3, AA4, AA5) +
START INIT-RTN
*----------------- BEGIN MATCH-MERGE PROCESS ----------------*
IF (EOF FILE1 OR EOF FILE2)
DISPLAY 'RECORD COUNT:'
DISPLAY INCREASE
END-IF
IF MATCHED
DISPLAY 'IN MATCHED'
PERFORM WRITE-REPORT-PARA
END-IF
IF DUPLICATE FILE1
DISPLAY 'DUPLICATE'
PERFORM WRITE-REPORT-PARA
END-IF |
I am getting A010 error for FILE2.
I want to know how does key comparision work as mentioned in JOB statement.
I am getting error when there is Duplicate condition of file1 is matched.
Does comparision chk works in following way:
Compariong key of FIle1 with total records of FILE2 for a match and than reading second record of FILE2 and same process repeats.
What happens if there is duplicate records in file1 and we are trying to use the INPUT variable of file2. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
use meaningful titles, useless titles will not help you to get better answers
since the post had nothing to do with db2 it was moved to the proper part of the forums
and the title was changed to something more useful |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
The "comparison check" does not do this:
Quote: |
Compariong key of FIle1 with total records of FILE2 for a match and than reading second record of FILE2 and same process repeats. |
You need to read about how a 2-file match/merge works (whether in Easytrieve or some other language).
Did you look up the A010 error in the documentation?
Quote: |
I want to know how does key comparision work as mentioned in JOB statement. |
This is described in the documentation. We are not able to "teach" products/code here. If you find something in the documentation that is not clear, post what you found from the manual and your doubt. Someone should be able to clarify. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
What happens if there is duplicate records in file1 and we are trying to use the INPUT variable of file2.
|
If file1 has duplicates and file2 has no matching keys (anymore) file2
variables will be undefined, hence the A010 error.
I guess a test for file2 present (IF FILE2) could solve that.
But to quote dick scherrer, consult the manual. |
|
Back to top |
|
|
|