$1 from vault_input.txt is the same that $4 from tst6.txt , that value is the index name for that associative array a
Example for the first line of vault_input.txt :
a[$1]=$2 would be a["3P04_Dep_Inxml"] = "2230" , therefore to obtain the value back you must use the index name 3P04_Dep_Inxml which is $4 for file tst6.txt
---------- Post updated at 10:23 PM ---------- Previous update was at 10:17 PM ----------
When you get to this point:
$4 in a {print a[$4], $3}
You are processing lines from file tst6.txt , so $1 is different that $1 from file vault_input.txt
and while you are reading tst6.txt , $1 always expands to "Nov" and a["Nov"] has never been set. Therefore, a[$1] expands to an empty string while a[$4] expands to the corresponding value that was set while reading vault_input.txt .