06-18-2014 03:39 PM
You can't, but you can cheat. But Why?
proc sort data=sashelp.class out=temp(keep=age);
'class' was sorted by 'name', now the 'age' is also sorted .
06-18-2014 03:42 PM
Sorting usually describes changing the order of data rows.
If I understand your questions correctly, they are about changing the order columns/fields within a table - please confirm. If you want to change the order of a field where would you want to place it? First? Last? The 10th field?
An example of what you want would be useful.
06-18-2014 03:47 PM
Sorting in SAS usually refers to changing the order of the rows. The entire row moves as a unit. However ...
If you are interested in changing the values of some of the fields within a single row, you can do that without affecting other fields within the same row:
call sortn (hand1, hand2, flop1, flop2, flop3, river, turn);
Use SORTN if your variables are numeric, or use SORTC if your variables are character.