View previous topic :: View next topic
|
Author |
Message |
r-a-v-i
New User
Joined: 30 Apr 2007 Posts: 4 Location: Hyderabad
|
|
|
|
Hi,
can any one tell me how the file matching works in EasyTrieve.
that is, the file matching crieteria.
FILE DRIVER FB(2 0)
A-RECORD 1 2 A
A-KEY1 1 1 A
A-KEY2 2 1 N
FILE DRIVEN FB(2 0)
B-RECORD 1 2 A
B-KEY1 1 1 A
B-KEY2 2 1 N
JOB INPUT (DRIVER KEY(A-KEY1 A-KEY2) +
DRIVEN KEY(B-KEY1 B-KEY2))
IF DRIVER
WS-MESSAGE = A-RECORD
DISPLAY WS-MESSAGE
END-IF
i have written a small prog to match two files. the contents of these files are :
Driver :
A1
A2
A3
Driven :
A1
A1
A1
A1
A6
A7
what is the output in this case and how that comes ?
Thank You very much... |
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
If you have written the program, why don't you run it to see what the output is?
Only then if you have any further queries, ask. |
|
Back to top |
|
|
r-a-v-i
New User
Joined: 30 Apr 2007 Posts: 4 Location: Hyderabad
|
|
|
|
Thanks for the Reply.
i ran the program, and the output is :
A1
A1
A1
A1
A2
A3
Here, i don't understand how the file matching works ?
in the prog, i specified the condtion "IF DRIVER". this means, only records in Driver file should come. so, the output should be "A1 A2 A3".
but, in the actual output "A1" is repeated 4 times.
can you explain me the flow of the program.
Thank you, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why should all occurrences of A1 not be placed in the output file? What code would prevent this?
I believe this is not quite what your code says
Quote: |
i specified the condtion "IF DRIVER". this means, only records in Driver file should come. |
I believe your code says that if the value is in the DRIVER or matches the DRIVER, display the A-RECORD.
You will want to verify that in the manual which is available from CA if your organization is licensed. |
|
Back to top |
|
|
|