Hello, In SAS I am importing two separate excel files and storing them in the work library. The excel files have a "primary" column that has blank numbers and numbers that are in decimals or whole numbers. For example, there are 0.40 , 1, 0.333, or a blank. Eventually I will create a new data set based off these two sets. The primary column is text from one file after I import it and the primary column is a numeric in the other file when I import. I get an error that one variable is numeric and the other variable is character. How do I normalize the data? I want to make sure both the primary columns are either numeric or text before I do a new data with combining or set the two data sets. The column is primary and it is a text type when I import it in the sas
proc import out=prf1
datafile= "filepath/example.xlsx"
dbms=excelcs
sheet="sheetname";
run;
The column is primary and it is a numeric type when I import it in the sas
proc import out=prf2
datafile= "filepath/example2.xlsx"
dbms=excelcs
sheet="sheetname";
run;
So I tried this
data prf2;
orig = 'primary ';
new = put(orig, $8.);
drop primary ;
rename new=primary ;
run;
I opened the fsview data and the primary column has converted to numbers but it rounded all to single digits, for example .643 became 1
data prf1;
orig = 'primary ';
new = input(orig, 8.);
drop orig;
rename new=primary ;
run;
When I tried this way, the primary column is blank and it doesnt have the values from the original primary column. It was all periods.
... View more