by BChat » Tue Jun 16, 2009 8:05 pm
Hi MF_usr,
It is possible with EZT Synchronized File Processing. But you have to do it in two steps (2 ezt). EZT Synchronized File Processing can match one set of FILE key. So in first step you match File1, File2, File3 and create intermediate file Temp say. And 2nd ezt to compare File1, File4 and Temp to create your final output.
Check CA easytrieve plus referrence guide (google it) & search for "Synchronized File Processing". It has a very nice example.
Very high level soln:
Assumption: You need to report records having match in all the 3 files. If not the EZT below needs a little change
Step 1 - 2 - 3 : Sort File 1, 2, 3 based on Ac/Nbr making all the Ac/Nbr in the output of same PIC if not so already. You can use the EZT sort also.
Step 4 : 1st Ezt like:
FILE FILE1
FILE1-AC-NBR 1 16 N
FILE1-CUST-NBR 17 16 N
FILE1-ATTRIB1 33 10 A
FILE FILE2
FILE2-REC-TYPE 1 4 A
FILE2-AC-NBR 5 16 N
FILE2-ATTRIB2 40 07 P 02
FILE FILE3
FILE3-AC-NBR 1 16 N
FILE3-ATTRIB3 50 07 A
FILE TEMP
TEMP-AC-NBR 1 16 N
TEMP-CUST-NBR 17 16 N
TEMP-ATTRIB1 33 10 A
TEMP-ATTRIB2 43 07 P 02
TEMP-ATTRIB3 50 07 A
JOB INPUT (FILE1 FILE(FILE1-AC-NBR) +
FILE2 FILE(FILE2-AC-NBR) +
FILE3 FILE(FILE3-AC-NBR))
IF NOT FILE1
STOP
ELSE-IF MATCHED
TEMP-AC-NBR = FILE1-AC-NBR
TEMP-CUST-NBR = FILE1-CUST-NBR
TEMP-ATTRIB1 = FILE1-ATTRIB1
TEMP-ATTRIB2 = FILE2-ATTRIB2
TEMP-ATTRIB3 = FILE3-ATTRIB3
PUT TEMP
END-IF
Step 5 - 6 - 7 : Sort File 1, 4 & temp based on Cust Nbr
Step 8 : A very similar EZT based on Cust nbr
Cheers,
BChat