Thanks so much for this!!! It works beautifully ... the one thing that kind of stood out though was the second record Agent_ID = 3456. The data is in reverse, it should be "Y O" ...
Your first example was successful, however the second one when changing the CTL1CNTL to your code gave me a S0C7 saying "UNSUCCESSFUL SORT" in the JESYSMSG