Passing DATASET Parameters

Passing a DATASET or a derived recordset as a parameter may be accomplished using the following syntax:

DefinitionName( DATASET( recstruct ) AliasName ) := expression;

The required recstruct names the RECORD structure that defines the layout of fields in the passed DATASET parameter. The recstruct may alternatively use the RECORDOF function. The required AliasName names the dataset for use in the function and is used in the Definition's expression to indicate where in the operation the passed parameter is to be used. See the DATASET as a Value Type discussion in the DATASET documentation for further examples.

MyRec := {STRING1 Letter};
    
SomeFile := DATASET([{'A'},{'B'},{'C'},{'D'},{'E'}],MyRec);

FilteredDS(DATASET(MyRec) ds) := ds(Letter NOT IN ['A','C','E']);
           //passed dataset referenced as "ds" in expression

OUTPUT(FilteredDS(SomeFile));