I am guessing from that that you want, for a given dataset and a given set of variables that you want to set them to missing, be it character or numeric. None of that code is necessary. Use Base SAS always, only resort to macro for repeated code.
Can you follow the new post guidance and provide test data in the form of a datstep and what you want out at the end - this makes a problem so much clearer. For instance, why are you creating one dataset for each variable? Do you need some sort of summary of missing data items as proc freq or summary can do that much easier.
... View more