I do not recommend doing this.
Instead, use an underscore instead of a space and then add a descriptive label.
data work.import2;
set work.import (rename=(on_methadone=methadone));
label on_methadone = 'On Methadone';
run;
title 'Original Data Set';
proc print data=import (obs=10) noobs label;
var methadone;
run;
title 'New Data Set';
proc print data=import2(obs=10) noobs label;
var on_methadone;
run;
@manthan wrote:
Hello
I have a column in my data set called On Methadone . It has Yes or No as answer choices under the column. I wanted to make a new variable called Methadone with Yes = 1 and No = 2 .. I tried using iF then statement to do this but it didn't work.. and it seems its because there is a space between On and Methadone.
So I tried to remove the space by renaming the column by the following command:
data work.import;
set work.import (rename=(on methadone=methadone));
run;
____________but I got the following error::
79
ERROR 79-322: Expecting a =.
Can anyone help me here ? I think the On thing is making it confusing.. not sure though