if everything after var %tempmsg is supposed to be the %var i think you need a = in between it