RETAIN

/*data step without retain*/ 
data test2;
pre_set=new_var;
set SASHELP.CLASS;
new_var=Weight * 10;
run;
/*data step with retain*/ 
data test1;
retain new_var;
pre_set=new_var;
set SASHELP.CLASS;
new_var=Weight * 10;
run;

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Christian Baghai

Christian Baghai

Consultant clinical statistical programmer