Hi

You do not need a data step to run the macro statement:
%put %sysget(sasroot);

If you want to do the same thing using data step code, it makes more sence to do it like this:
data _null_;
sasroot = sysget('sasroot');
put sasroot;
run;

Regards