How can I convert values of a variable to percentiles 0-100?

I have tried pctile but it does not give the correct results.