art photo

DSDR KB

Q:  

I am trying to merge two files using SAS and I am getting a message that says "variable stcnty has been defined as both character and numeric." The merge did not work.

A:  

Take a look at your input format statements. You have read your merging variable (stcnty) in as a character variable in one case, e.g., (stcnty $ 1-5) and as a numeric variable (stcnty 1-5) in the other. Change the format in one case so that they have the same format.

If this is a system file and you cannot see the input format, you can change the character variable to a numeric variable using these commands:

newid = stcnty*1;

Related Question Groups:


W A R N I N G

If you are reading this, it may be that you are using rather old web browsing software that does not support modern international Web technology standards. For a better experience of the Web and this site in particular, please upgrade your web browser software. The following are good choices:

Firefox
Opera
Safari