I am trying to stack three data sets that are almost identical, however, some of the variables are character when the same variable another dataset is numberic. I am trying to get each data set to have identical formatting so I can stack them into one data set. I have tried this code from the SAS website: data new;
orig = '12345678';
new = input(orig, 8.);
drop orig;
rename new=orig;
run; but it has not seemed to work. Here is what it looks like when I do it. data testpalmbeach17;
set finalsii.palmbeachfinal17;
exmpt_04 = $1.;
exmpt_04 = input(exmpt_04, best12.);
drop exmpt_04;
rename exmpt_04=exmpt_04;
run; Here is the log: 351 data testpalmbeach17;
352 set finalsii.palmbeachfinal17;
353 exmpt_04 = $1.;
---
386
200
354 input (exmpt_04, best12.);
-
22
76
ERROR 386-185: Expecting an arithmetic expression.
ERROR 200-322: The symbol is not recognized and will be ignored.
ERROR 22-322: Syntax error, expecting one of the following: a name, arrayname, ), -, :, [, _ALL_,
_CHARACTER_, _CHAR_, _NUMERIC_, {.
ERROR 76-322: Syntax error, statement will be ignored.
355 drop exmpt_04;
356 rename exmpt_04=exmpt_04;
357 run;
ERROR: No DATALINES or INFILE statement.
WARNING: The variable exmpt_04 in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TESTPALMBEACH17 may be incomplete. When this step was stopped there
were 0 observations and 181 variables.
WARNING: Data set WORK.TESTPALMBEACH17 was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.20 seconds
cpu time 0.04 seconds
... View more