1. proc sort data=original; by uid; run;
2. data lead (rename=(a-b)); set orginal (firstobs=2); run;
3. data merge; set original; set lead (drop=uid); run;
4. data wanted; set merge (drop=a); by uid; if last.uid then b=.; run;
Just my first thought, have not tested it.