Responding to post #13, here's an something that may help. We'll extract a variable number from the end of the depvar string, converting it to a number so it sorts in numeric order rather than string order. Add these two commands following the reshape.
Code:
generate varnum = real(substr(depvar,5,.)) sort varnum
Comment