proc rank data=mydata groups=10 out=newdata; var x z; ranks decile_x decile_z; run;
Equal Frequency Discretization (EFD)