File1

    #CHROM  POS     ID      REF_Zv  ALT_lm                             
    chr1A   219620  .       T       A
    chr1A   219648  .       A       G
    chr1A   219867  .       A       G

file2

    #CHROM  POS     ID      REF_Zv  ALT_RV                             
    chr1A   219457  .       C       T
    chr1A   219670  .       A       G
    chr1A   219867  .       A       C

File3                                 

    #CHROM  POS     ID      REF_Zv  ALT_lm ALT_RV                            
    chr1A   219620  .       T       A    NA
    chr1A   219648  .       A       G    NA
    chr1A   219867  .       A       G    C
    chr1A   219457  .       C       NA   T
    chr1A   219670  .       A       NA   C 


My command is

    awk 'FNR==NR{a[$1,$2];next} {if(a[$1,$2]==""){a[$1,$2]=0};print $1,$2,$3,$4,$5, a[$4,$5]} ' file1 file2 > file3

However,
I can not get the file3 which I want.
Could you help me improve the command?
Thanks,
Fuyou
Using **R** *merge*:

    # example files
    file1 <- read.table(text = "#CHROM  POS     ID      REF_Zv  ALT_lm                             
    chr1A   219620  .       T       A
    chr1A   219648  .       A       G
    chr1A   219867  .       A       G", header = TRUE, stringsAsFactors = FALSE,
                        comment.char = "")
    file2 <- read.table(text = "#CHROM  POS     ID      REF_Zv  ALT_RV                             
    chr1A   219457  .       C       T
    chr1A   219670  .       A       G
    chr1A   219867  .       A       C", header = TRUE, stringsAsFactors = FALSE,
                            comment.char = "")

    merge(file1, file2, by.x = c("X.CHROM", "POS", "ID", "REF_Zv"), all = TRUE)
    #   X.CHROM    POS ID REF_Zv ALT_lm ALT_RV
    # 1   chr1A 219457  .      C   <NA>      T
    # 2   chr1A 219620  .      T      A   <NA>
    # 3   chr1A 219648  .      A      G   <NA>
    # 4   chr1A 219670  .      A   <NA>      G
    # 5   chr1A 219867  .      A      G      C

