Hello!
I am currently trying to use the ONET Soc Code which has values such as 11-1011.00. When trying to destring after importing the Excel file, I am not able to. I even made sure that the option that says "import data as strings" is not checked. I'm not sure if I need to change the Excel sheet numbers so that they don't have the dash - or not.
Additionally, when I am recoding a current dataset to have the same format as above (11-1011.00), Stata codes it as -1010 because it is subtracting the two numbers together. My code is the following
I tried to do the following code, but ended up with a type mismatch r(109); error
Not sure if this is enough information, but hopefully I can get some guidance! Thank you!
I am currently trying to use the ONET Soc Code which has values such as 11-1011.00. When trying to destring after importing the Excel file, I am not able to. I even made sure that the option that says "import data as strings" is not checked. I'm not sure if I need to change the Excel sheet numbers so that they don't have the dash - or not.
Additionally, when I am recoding a current dataset to have the same format as above (11-1011.00), Stata codes it as -1010 because it is subtracting the two numbers together. My code is the following
Code:
gen job = . replace job = 11-1011.00 if M540A ==003
Code:
replace job = "11-1031.00" if M540A ==003
Comment