The error quite clearly tells you the problem, you cannot change the type of a column. How can name be both character and numeric? If it contains non-numeric information, then it is not a numeric field. The general rule would be, create the structure, then add the data into the given structure, so an example:
proc sql;
create table target (id char(30),name char(30));
quit;
data target (drop=_name);
set target
/* Here I move the data to a new column so as not to confuse the
compiler with a numeric and character field of the same name */
source (rename=(name=_name));
/* Here I take the numeric data and put it into text in the character field */
name=strip(put(_name,best.));
run;
What this does is create a temporary variable _name which is dropped at the end, which contains the numeric data, I put() this into the character variable. No alteration of the base table is done. You can of course do it the other way and convert character to numeric - however be aware that will fail if there is non-numeric data:
proc sql;
create table target (id char(30),name num);
quit;
data target (drop=_name);
set target
source (rename=(name=_name));
name=input(_name,best.);
run;
... View more