I'm sharing the code with you all:
data abc(keep=name column2 column3);
where libname='WORK' and memname='FAIRVIEW_FIN';
if substr(name,1,1) = '_' then column2 = substr(name, 2, length(name));
select distinct column3 into: new_column seperated by ' '
data Fairview_fin (rename = (&new_column));
You can use the SAS option "validvarname=any".
If "any" is set then the Excel variable names won't be converted to comply with SAS naming conventions during import.
You can do it - but I wouldn't as it will cause you quite a bit of pain. Variables with non-conforming names must be addresses as literals meaning that whenever you use the variable you have to quote the name in the form: ''n
For SAS EG 4.2
In step 2 of the import wizard there is a checkbox "rename columns to comply with SAS naming conventions". Make sure that this checkbox is not ticked if you want to avoid the conversion.
Again: I recommend to choose conversion. You still keep the excel source variable names as SAS variable labels.