Add CHROMOSOMELABEL and POSITIONLABEL for each input file in the Metal command file. I also recommend considering the random-effects model using Random-Metal or GWAMA software to account for heterogeneity.
It's not needed to define custom variables. Both CHROMOSOMELABEL and POSITIONLABEL are predefined commands/keywords in Metal. Just use them for each input. I've forgotten to say that you need to add "TRACKPOSITIONS ON" at the top of your command file.