New SAS user here. I'm attempting to convert character values to numeric values using arrays. After the conversion, I would like to DROP all the fields that comprise my initial array (character values). Is there a way to drop only the variables that appear in my character values array? data test;
infile datalines delimiter=',';
input col1 $ col2 $ col3 $ oddball $;
format col1--oddball $char100.;
datalines;
1,2,0,a
2,3,0,b
3,4,0,c
;
run;
data test2;
set test;
format newCol1-newCol3 best.;
array myarray Col1-Col3;
array myNewarray newCol1-newCol3;
do i=1 to dim(myarray);
myNewarray[i]= input(myarray[i],best.);
end;
drop myarry[*];
run; I'm receiving the error at the DROP statement.
... View more