data test.ds1;
set test.ds;
age=23;
gender=M;
run;
In this code, is there a variable called M in test.ds. There isn't is there, what you are trying to do is set gender to the value of a string of characters, hence you need to enclose that string of characters within quotes either single or double:
data test.ds1;
set test.ds;
age=23;
gender="M";
run;
... View more