I have a large number of excel workbooks, all of them sharing the same column header/variable names. When I read them in using proc import, the same variables are sometimes numeric and other times character. For example a date variable can be read as numeric, but also gets turned into character in files with all missing date values. If I want to stack them together, I run into this problem. Is there a quick automated way to go through all datasets, and get them to agree on the right variable formats as well as lengths (so nothing gets truncated in stacking)? I found a close solution here in the answer given by username Oligolas and I tried it. I does work, but seems like it turns everything into character. But I would like to keep what should be numeric numeric. If dates are all missing, I want that to be numeric so they can be merged with non-missing dates from other files. I guess the logic is that for each variable, if it's seen a numeric in any of the imported files, then make it alwasy numeric. If it's always character, then make it character. Not quite sure how to implement this. Thanks. https://communities.sas.com/t5/Base-SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/td-p/255993
... View more