tssort - Sorts terascan dataset variables

SYNOPSIS

tssort  [ parameter=value ... ]  [ inputfile outputfile ]
tssort  [ parameter=value ... ]  [ inputfile ... directory ]

Parameters are: include_vars, sort_vars, ascending_sort.

DESCRIPTION

The function tssort creates a file of output variables specified by include_vars and sorted using sort_vars as a (multiple) key. All variables from include_vars and sort_vars should be parallel, i.e. having the same leading dimension size. In addition, sort_vars should be 1-D and include_vars can't be more than 2-D (1-D for string type).

PARAMETERS

include_vars

Variables to be sorted and put into the output file(s). Should exist in all input files and be parallel within each input file.

Valid response is a list of names. There is no default.

sort_vars

Variables used for sorting. Should exist in all input files and be parallel to each other and to include_vars within each input file.

Valid response is a list of names. There is no default.

ascending_sort

Whether or not sort_vars should be sorted in the ascending order. The alternative is descending order of sorting.

Valid responses are [yes or no]. The default is yes.

EXAMPLES

The following is and example of how to sort variables in a dataset. The sort variables are specified by the user.

The first print out is of the original dcs dataset before it has been sorted. Now you are ready to sort according to the platform_id variable.

Note: This is a partial printout of a dcs dataset because the original is too long.

Printvar  n11.93209.1130  Page 1

         date            time platform_id dcs_doppler dcs_quality   dcs_count
   1   930728       113020.74        1016      109256           0           0
   2   930728       113020.97        3633      356777           0           0
   3   930728       113021.51        8295      121636           0           3
   4   930728       113021.57        8155      360908           0           7
   5   930728       113023.45        8677      256043           0           0
   6   930728       113024.05        1718      359993           0           0
   7   930728       113024.48       12512      261036           0           1
   8   930728       113024.38        8294       98495           0           3
   9   930728       113025.59        9239      153797           0           0
  10   930728       113026.05        4484      287156           0           0
  11   930728       113026.43        1721      309339           0           0
  12   930728       113026.33       11175      204736           0           7
  13   930728       113028.29       12406      335030           0           0
  14   930728       113028.31        5578      218786           0           7
  15   930728       113029.72        1719      217052           0

% tssort
in/out files   : char(255) ? n11.93209.1130 n11.tssort
include_vars   : char(255) ? [] *
sort_vars      : char(255) ? [] platform_id
ascending_sort : char(  3) ? [yes]
%

This is the print out of the sorted dataset called n11.tssort. Note: The platform_id is now sorted in ascending order.

Printvar  n11.tssort  Page 1

         date   dcs_count dcs_doppler dcs_quality platform_id            time
   1   930728           0      265795           0         106       113047.34
   2   930728           0      255314           0         106       113118.45
   3   930728           0      244253           0         106       113149.57
   4   930728           0      233416           0         106       113220.67
   5   930728           0      222370           0         106       113251.78
   6   930728           0      211928           0         106        113322.9
   7   930728           0      201662           0         106       113354.02
   8   930728           0      192047           0         106       113425.14
   9   930728           0      183227           0         106       113456.27
  10   930728           0      167705           0         106       113558.49
  11   930728           0      150335           0         106       113731.86
  12   930728           0      360154           0         110       113048.23
  13   930728           0      357574           0         110       113118.02
  14   930728           0      349999           0         110        113217.6
  15   930728           0      337340           0         110

Now we will sort in descending order.

% tssort
in/out files   : char(255) ? n11.93209.1130 n11.tssort2
include_vars   : char(255) ? []
sort_vars      : char(255) ? [] platform_id
ascending_sort : char(  3) ? [yes] no
%

This is the print out of the dataset sorted in descending order. Look at the platform_id, it is now in descending order.

Printvar  n11.tssort2  Page 1

         date   dcs_count dcs_doppler dcs_quality platform_id            time
   1   930728           0      321584           0       16287        113912.8
   2   930728           0      301654           0       16287       114042.81
   3   930728           0      272716           0       16287       114212.79
   4   930728           7      142905           0       16286       113941.46
   5   930728           0      370216           0       16279       113824.52
   6   930728           0      365219           0       16279       113956.51
   7   930728           0      351679           0       16279       114128.51
   8   930728           0      312400           0       16279        114300.5
   9   930728           0      354123           0       16259       114148.33
  10   930728           0      367810           0       16078       113100.71
  11   930728           0      365135           0       16078        113150.7
  12   930728           0      360380           0       16078       113240.71
  13   930728           0      352476           0       16078       113330.69
  14   930728           0      338251           0       16078        113420.7

SEE ALSO

findcases, sortstats, datasets


Last Update: $Date: 1999/05/10 20:46:50 $