sortfunnel: syntax and options
The syntax and options for the sortfunnel operator.
The -key option is required. Multiple key options are allowed.
sortfunnel -key field [-cs | -ci] [-asc | -desc] [-nulls first | last] [-ebcdic] [-param params]
[-key field [-cs | -ci] [-asc | -desc] [-nulls first | last] [-ebcdic] [-param params] ...]
[-collation_sequence locale | collation_file_pathname | OFF]
| Option | Use |
|---|---|
| -collation_ sequence | -collation_sequence locale |collation_file_pathname |
OFF This option determines how your string data is sorted. You can:
By default, InfoSphere® DataStage® sorts strings using byte-wise comparisons. For more information, reference this IBM ICU site: http://oss.software.ibm.com/icu/userguide/ Collate_Intro.htm |
| -key | -key field [-cs | -ci] [-asc | -desc] [-nulls first | last]
[-ebcdic] [-param params] Specifies a key field of the sorting operation. The first -key defines the primary key field of the sort; lower-priority key fields are supplied on subsequent -key specifications. You must define a single primary key to the sortfunnel operator. You can define as many secondary keys as are required by your job. For each key, select the option and supply the field name. Each record field can be used only once as a key. Therefore, the total number of primary and secondary keys must be less than or equal to the total number of fields in the record. -cs | -ci are optional arguments for specifying case-sensitive or case-insensitive sorting. By default, the operator uses a case-sensitive algorithm for sorting, that is, uppercase strings appear before lowercase strings in the sorted data set. Specify -ci to override this default and perform case-insensitive sorting of string fields. -asc | -desc are optional arguments for specifying ascending or descending sorting By default, the operator uses ascending sorting order, that is, smaller values appear before larger values in the sorted data set. Specify -desc to sort in descending sorting order instead, so that larger values appear before smaller values in the sorted data set. -nulls first | last By default fields containing null values appear first in the sorted data set. To override this default so that fields containing null values appear last in the sorted data set, specify nulls last. -ebcdic By default data is represented in the ASCII character set. To represent data in the EBCDIC character set, specify this option. The -param suboption allows you to specify extra parameters for a field. Specify parameters using property=value pairs separated by commas. |
In this osh example, the sortfunnel operator combines two input data sets into one sorted output data set:
$ osh "sortfunnel -key Lastname -key Age < out0.v < out1.v > combined.ds