I have a problem of joining 2 files with different position of key column
file1
INDIA|LEFT|123
USA|RIGHT|345
CHINA|LEFT|234
file2
123|HIGH
345|LOW
expected output
INDIA|LEFT|123|HIGH
USA|RIGHT|345|LOW
CHINA|LEFT|234|
based on column 3 in file 1 and column 2 in file 2, I want to print file1 plus its value from file2
I did this
awk -F"|" 'FILENAME=="file2"{A[$2]=$2} FILENAME=="file1"{if(A[$3]){print}}' file2 file1
but it keeps fail, lease any help