awk command hash array not printing

I'm new to awk command.

The HASH ARRAY is not printing. Merging 2 files togather.

vault_input.txt

3P04_Dep_Inxml:2230
REM02_Dep_Inxml:2200
REM03_Dep_Inxml:2400
REM05:2200
REM06:2200

tst6.txt

Nov:10:2115:3P04_Dep_Inxml
Nov:10:2129:REM02_Dep_Inxml
Nov:10:2235:REM03_Dep_Inxml

using following command:

awk 'NR==FNR{a[$1]=$2;next} $4 in a {print $4 a[$1] $3}' FS=":" vault_input.txt tst6.txt 

OUTPUT
3P04_Dep_Inxml2115

REM02_Dep_Inxml2129
REM03_Dep_Inxml2235

DESIRED RESULT

3P04_Dep_Inxml 2230  2115
REM02_Dep_Inxml 2200 2129
REM03_Dep_Inxml 2400  2235

Looks like "$4 in a" is extracting correct info but nothing is getting populated
in a[1].

THanks

awk 'NR==FNR{a[$1]=$2;next} $4 in a {print $4, a[$4], $3}' FS=":" vault_input.txt tst6.txt

or:

awk 'NR==FNR{a[$1]=$1OFS$2;next} $4 in a {print a[$4], $3}' FS=":" vault_input.txt tst6.txt

Try:

print $4,a[$4],$3

THankyou aia thankyou...it works

---------- Post updated at 11:06 PM ---------- Previous update was at 10:54 PM ----------

Aia

Thanks couild you expalin how (print $4, a[$4], $3) this works and not {print $4 a[$1] $3}
This will help me understand for future refrences.

Thanks so much..i've been at this for 3 days

$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

Expanding on what Aia has already said... When you're reading vault_input.txt , using $1 as your index in the array a you are setting:

a["3P04_Dep_Inxml"] = 2230
a["REM02_Dep_Inxml"] = 2200
a["REM03_Dep_Inxml"] = 2400
a["REM05"] = 2200
a["REM06"] = 2200

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 .