/*
data d(rename=(x=xx));
set a (keep=x);
if x=1 then m=10;/**改写成 if xx=1 then m=10; 后,m为空?***/
run;
*/
It is noted that the data step will first read all command you specified within the step
(note that SAS does not read in order by according to importance)
SAS first reads 'set a (keep=x)' to retrieve column x
Then, SAS generates a new variable m because you specify that 'if x=1 then m=10;'
SAS does not know what 'xx' is so far because the variable xx is not yet defined.
Finally, you put this data into dataset d.
When you put this data into d, you then rename x by xx.
Therefore, you could only use 'x' instead of 'xx' as the variable within the data step.