Sir It is the sample table Data emp; infile datalines truncover; input id ename$ dept$ sal; datalines; 1 A account 100 2 B HR 200 3 c Dev 400 4 D account 600 5 E account 700 6 F HR 500 7 G HR 300 8 H Dev 800 9 I Dev 250 ; Proc sql; select * from emp order by sal desc; quit; Proc sql; SELECT monotonic() as rank, ename, sal from(select ename, sal from emp order by sal desc) where calculated rank<= 3; quit; It is coming in log Proc sql; 431 Select * from (select *,monotonic()as x from emp order by sal descending) ; ----- - 79 22 - 200 ERROR 79-322: Expecting a ). ERROR 22-322: Syntax error, expecting one of the following: ;, ','. ERROR 200-322: The symbol is not recognized and will be ignored. 432 quit; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time 0.00 seconds I just want to solve it using Pro sql.
... View more