Question: what is gsort in stata?
Answer: Description. gsort arranges observations to be in ascending or descending order of the specified variables and so differs from sort in that sort produces ascending-order arrangements only; see [D] sort. Each varname can be numeric or a string.