More info
Apologies vgersh99 I'll try to elaborate.
fileA would look something lke this
500,22,1001,16,22,0,4
501,23,2004,16,26,1,9
502,44,1003,18,0,0,10
503,43,1000,22,1,14,15
504,40,1006,20,0,22,22
505,32,1009,21,11,32,88
fileB might look like this:
500,Florence,30,477
501,Zebedee,28,505
503,Dougal,80,609
504,Brian,70,300
As you can see, 502 and 505 are missing from fileB and therefore the match would fail. There wouldn't be an instance where fileB contained a value in 1st fields which doesn't appear in fileA.
The output should contain the first 4 fields from fileA together with fields 3 and 4 from fileB on the same line. Where there is no match in fileB these values should contain zero.
EG
500,22,1001,16,30,477
501,23,2004,16,28,505
502,44,1003,18,0,0
503,43,1000,22,80,609
504,40,1006,20,70,300
505,32,1009,21,0,0
Hope this makes more sense - thanks again