Hi All,
I am having 2 Sequential Files Say File A (LRECL = 500) & File B(LRECL = 300). I need to Compare 2 Files based on Item Number. For File A Item Number Start Position is 01 & Item Field Length is 06, Where as for File B Start Position of Item Number is 13 And Item Field Length is 06. We need to Write all Records from File A to The Output File (File C).Output File is Having Same Attribute as File A. Before Writing Records to Output File C, We need to Check, If Item Number is > 499999, Then we Need to Move Spaces to a Specific Field which is of Length 2 Bytes with Start Position as 25. If Item Number is < 499999 thn what ever value it is Having need to be Passed. If Item Number is > 499999 Present in File A but Not in File B, No Need to Move Space to the Field Start at Position 25. Below is the Example.
File A:
123456|ABCDE12345|12|XYZ..........
111111|XYZAB44444|20|ABC..........
599999|WQZX55555|30|OPQ..........
699999|ABCDE12345|12|XYZ..........
File B:
123456|ABCDE12345|12|XYZ..........
111111|XYZAB44444|20|ABC..........
599999|WQZX55555|30|OPQ..........
File C: (Output File)
123456|ABCDE12345|12|XYZ.......... Item 123456 Present in File A & File B, But < 499999, O/P File to Have 12.
111111|XYZAB44444|20|ABC.......... Item 111111 Present in File A & File B, But < 499999, O/P File to Have 20.
599999|WQZX55555| |OPQ.......... Item 599999 Present in File A & File B, But > 499999, O/P File to Have Space Instead of 30 (File A).
699999|ABCDE12345|12|XYZ.......... Item Present in File A But Not in File B. But Item Number > 499999. O/P Should have 12 Instead of Space.
Note: O/P Record Count To Be Equal to File A Record Count.
Thanks
Kind Rgds
Vineet Anand