In reply to Msuva.

Msuva,
You should post programming questions to the SAS Support Communities. In this case, add a BY statement that specifies the strata. For example, if you want quintiles separately for males and females, you can use

proc sort data=Have out=Want;
by Sex;
run;

proc rank data=Want out=RankOut groups=5;
by Sex;
var MyVar;
ranks rank;
run;