If you search online for “how to transpose using PROC SQL” you will be told – repeatedly – that it cannot be done. Out of curiosity I decided to ignore the advice, and my solution came to 345 lines, achieving what PROC TRANSPOSE can do in 6; proving that you can do it – you just shouldn’t. However, tackling the challenge requires us to look deeper at tree traversal, used for finding combinations of variables for the transposed columns. Within SAS, basic tree traversal methods include nested and macro do loops, and as we get more advanced we can create efficient algorithms dealing with file searching, data-structuring and much more. This blog will give an overview of my method for transposing and use it to show how tree traversal can be understood and implemented in SAS.