Alex,
It is possible that the solution from @Kurt_Bremser is exactly what you need. But my ears pick up when I hear "Excel" and just want to make sure you are heading in the right direction.
When data come in from Excel, it is likely that you run into other types of problems. Do character variables have the same lengths every time? Could a variable be character in one data set but numeric in another data set? For either of these cases, keeping the list of variables will hide your problem rather than uncover it.
One way to approach the problem would be to construct a LENGTH statement as well as a KEEP statement. That way you can set the lengths and have SAS give you some warning if a data set is not compatible with those lengths. Besides a LENGTH statement, another method would be to create a data set with all the needed variables You don't have to populate the variables, just define them. Then you could use:
data want;
if 0 then set correct_lengths;
keep _all_;
set one_data_filled_dataset;
run;
We don't really know the situations you will encounter, so this is really just a word of warning about what you might encounter.