You might find this paper I did some years ago to be helpful: https://support.sas.com/resources/papers/proceedings11/277-2011.pdf