04-27-2016 02:23 AM
I know this problem has been answered a couple of times. But I tried most of the solution but I'm still unable to merge them and it's quite frustrating... so hope that you guys can help me see what's the problem here:
The data MATCH has account ID (numerical) with other variables and TOMATCH has only account ID (numerical) and counts (numberical). Hence, I would like to merge the files so that my new data COMBINEFILES will have the account numbers and the counts.
data match; set match(rename=(account=acc)); account=input(acc,f15.); drop acc; run; data tomatch; set tomatch (rename=(account=acc)); account=input(acc,f15.); drop acc; run; data combinefiles; merge match (in=a) tomatch (in=b); by account; if a; run;
But the output is always:
ERROR: Variable b has been defined as both character and numeric.
ERROR: Variable a has been defined as both character and numeric.
Really appreciate if you guys can help me.
04-27-2016 05:14 AM
Really sorry... I didn't check my variables properly as it's a huge dataset...
I have a variable named a and b so that's why I am unable to merge.
But thank you once again! Will check more diligently next time!
04-27-2016 02:50 AM
set tomatch1 (rename=(account=acc));
merge match1 (in=a) tomatch1 (in=b);
04-27-2016 05:05 AM
Your error doesn't match your data description.
Please post code and log if you need further assistance.
@pearsoninst Is correct about checking your IN variables.
Need further help from the community? Please ask a new question.