The Column Viewer option "Sort By Name" only sorts an internal list of the column names. It does not change the order of the columns in the data table. It does change the order of the statistical output, for any Show Summary requests that are made after a "Sort By Name" has been selected.
To do a similar item in JSL, the below example would be one way to accomplish it.
names default to here(1);
dt=open("$SAMPLE_DATA/big class.jmp");
myColList = dt << get column names();
myColList = sortlist(myColList);
dt << summary( n(eval(myColList)));
Jim