Best option is not to use EXCEL to store data. If the data was in a text file or an actual database then you would have control over how the variables were defined.
But that is probably impossible to implement in your case.
If your only concern is for variables that have become character because all of the cells in that column are empty then perhaps the easiest thing to do is DROP the variable(s).
One way to find out if the variable is empty that should not require too much coding is using the NLEVELS option of PROC FREQ.
So perhpas use something like this:
proc import ... out=THIS_SHEET ...
....
run;
ods output nlevels=nlevels;
proc freq nlevels data=THIS_SHEET ;
tables _all_ / noprint;
run;
%let dropvars=;
proc sql noprint;
select nliteral(tablevar) into :dropvars separated by ' '
from nlevels
where nnonmisslevels=0
;
quit;
proc append base=base_file data=THIS_SHEET(drop=&dropvars) force;
run;
... View more