I want to join 2 files. The condition is if the key matches then join the files based on the key, but if the record is only present in 1st file and not in 2nd file the output should have record of 1st file and the 2nd file details should be populated as spaces.
File 1 input:
File 2 Input
The output i am expecting is
001 NITIN BHARGAVA
002 RAHUL GUPTA
004 ABCD EFGH
I am having a record as
001 NITIN BHARGAVA N 02500 09500 10 A 22 013B
002 RAHUL GUPTA Y 03500 08000 20 A 98 017B
Now for key 001 if the field is 'N' I have to multiply the next two numbers i.e. 02500 and 09500 and replace them by the product. if it is 'Y' as in key 002 the output should be zero. In the same step i have to check if the person code is '10' then add a description as 'OWNER' it can be max 15 bytes. For person code '20' (as in key 002) i have to add a description as 'INSURED'. for status code '22' it is 'ACTIVE' for status '98' it is 'TERMINATED'.
The output will look like
001 NITIN BHARGAVA N 23750000 10 OWNER A 22 ACTIVE 013B
002 RAHUL GUPTA Y 00000000 20 INSURED A 98 TERMINATED 017B