ENTH(recordset, numerator [, denominator [, which ] ] [, LOCAL] [, UNORDERED | ORDERED( bool ) ] [, STABLE | UNSTABLE ] [, PARALLEL [ ( numthreads ) ] ] [, ALGORITHM( name ) ] )

recordsetThe set of records to sample. This may be the name of a dataset or a record set derived from some filter condition, or any expression that results in a derived record set.
numeratorThe number of records to return. The chosen records are evenly spaced from throughout the recordset.
denominatorOptional. The size of each set from which to return numerator number of records. If omitted, the denominator value is the total number of records in the recordset.
whichOptional. An integer specifying the ordinal number of the sample set to return. This is used to obtain multiple non-overlapping samples from the same recordset. If the numerator is not 1, then some records may overlap.
LOCALOptional. Specifies that the sample is extracted on each supercomputer node without regard to the number of records on other nodes, significantly improving performance if exact results are not required.
UNORDEREDOptional. Specifies the output record order is not significant.
ORDEREDSpecifies the significance of the output record order.
boolWhen False, specifies the output record order is not significant. When True, specifies the default output record order.
STABLEOptional. Specifies the input record order is significant.
UNSTABLEOptional. Specifies the input record order is not significant.
PARALLELOptional. Try to evaluate this activity in parallel.
numthreadsOptional. Try to evaluate this activity using numthreads threads.
ALGORITHMOptional. Override the algorithm used for this activity.
nameThe algorithm to use for this activity. Must be from the list of supported algorithms for the SORT function's STABLE and UNSTABLE options.
Return:ENTH returns a set of records.

The ENTH function returns a sample set of records from the nominated recordset. ENTH returns numerator number of records out of each denominator set of records in the recordset. Unless LOCAL is specified, records are picked at exact intervals across all nodes of the supercomputer.


SomeFile := DATASET([{'A'},{'B'},{'C'},{'D'},{'E'},
     {STRING1 Letter});
Set1 := ENTH(SomeFile,2,10,1); // returns E, J, O, T, Y

// other examples
// MySample1 := ENTH(Person,1,10,1); // 10% (1 out of every 10)
// MySample2 := ENTH(Person,15,100,1); // 15% (15 out of every 100)
// MySample3 := ENTH(Person,3,4,1); // 75% (3 out of every 4)