Common column is first column, not 2nd. Correct syntax would be awk 'FNR==NR {data[$1]=$1; next} $1 in data' file1.txt file2.txt. Since both the files do not share any common values, it would be blank.
$ awk 'NR==FNR{data[$1]=$2; next}{print ($1, data[$1]) }' file1.txt file2.txt
1:838916:A:T
1:839461:T:C
1:839495:G:T
1:839528:A:G
1:839529:T:G
1:840353:G:C
$ awk 'FNR==NR {data[$1]=$1; next} $1 in data' file1.txt file2.txt
No output
If I add 1:10150:C:T from column 1 of file 1, to file2, output is as follows:
$ awk 'NR==FNR{data[$1]=$2; next}{print ($1, data[$1]) }' file1.txt file2.txt
1:838916:A:T
1:839461:T:C
1:839495:G:T
1:839528:A:G
1:839529:T:G
1:840353:G:C
1:10150:C:T rs371194064
$ awk 'FNR==NR {data[$1]=$1; next} $1 in data' file1.txt file2.txt
1:10150:C:T
However user wants to print matching lines from file 1, it would be:
$ awk 'NR==FNR {a[$1]; next} $1 in a {print}' file2.txt file1.txt
joinneeds file to be sorted. If program throws an error on sorting, sort both the files and join.