What's so bad about these procedures that you can't use them?
Why do you need to reinvent the wheel? What is inadequate about the existing wheel?
Then you have to use PROC IML .
Calling @Rick_SAS
This is an older answer that may get you started.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.