I don't think it is possible to re-write in proc sql. In SQL(like ms sql , or Teradata SQL) , if you wish to write then may be will have to carefully partition by and rank function (window functions in general) . but partition by and rank functions do not work in Proc sql . So, writing it using data step is the way forward i suppose. Thanks a lot .
... View more