dt is not supposed to change here. The table variable dt still linked to the original table because you have not reassigned it.
In the code you assign the summary table to the table variable summary_table_name (you can use almost any name). To sort that table use
summary_table_name<< sort(...);
If you want to make jmp to forget dt and reuse that name for the summary table, try:
dt = dt << summary(...) ;
But that's not wise if you'll need to address the original table later in the script. Look