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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.