Hi,
After combining my data I got some errors such as
data combined;
68 merge study4s study4s2;
ERROR: Variable gender has been defined as both character and numeric.
ERROR: Variable english has been defined as both character and numeric.
ERROR: Variable describejeans_1__Description_of_ has been defined as both character and numeric.
I heard that SAS doesn't read blanks so I filled all the blanks with 999 in excel before importing here. That's the reason why I am getting those errors but I don't know how to fix it. Any suggestions?
Thanks,
Sara
You're quite welcome! and perhaps the professors example was meant to show you this fact about merging in sas.
If you like, you can specify what OUtput dataset you want (which columns do you want, do you want the variables Gender and Gender1 from datasets A and B to be distinct? if so a rename statement would be helpful!).
Let me know what you are trying to do and I can help you write it / explain it. However I think some time spent looking up the fundamental rules for sas merging would be helpful!
Good luck.
Hey! You started a new thread, it's much better for you to place this in your previous thread so people can read through and help you better!
basically the errors you are getting are exactly what you are seeing. The values of "gender" and "english" are character in one dataset and Numeric in another, this cannot happen in a merge statement because of the way that SAS merges things.
For clarification, do you happen to know the rules of SAS and merging? Aka are you aware that if variables have the same name in two distinct datasets they will actually be over-written instead of outputting two columns with the same name?
Brandon
I didn't know that. This is the first time I am trying to write something and it doesn't go smoothly but I am trying to learn by myself. I have to ask this issue to my professor I guess because I don't know how to fix it myself.
P.S: I posted it to the previous thread as well.
Thanks so much.
You're quite welcome! and perhaps the professors example was meant to show you this fact about merging in sas.
If you like, you can specify what OUtput dataset you want (which columns do you want, do you want the variables Gender and Gender1 from datasets A and B to be distinct? if so a rename statement would be helpful!).
Let me know what you are trying to do and I can help you write it / explain it. However I think some time spent looking up the fundamental rules for sas merging would be helpful!
Good luck.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.