My code was this:
data test.ds1;
set test.ds;
age=23;
gender=M;
run;
and my log window is showing this message:
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;
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;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.