OBSOLETE. Catalysis of the reactions: S-adenosyl-L-methionine + glycine = S-adenosyl-L-homocysteine + sarcosine, and S-adenosyl-L-methionine + sarcosine = S-adenosyl-L-homocysteine + N,N-dimethylglycine.