Page tree
Skip to end of metadata
Go to start of metadata

The code snippet shows you how to traverse the products dataset and convert all product names to upper case.

Prerequisite

The code shown below is an extension of Organizing ECL Code

 

CleanProductsJob.ecl
IMPORT in.Products AS products;
IMPORT Std;

//Clean a product record by converting all the product names to uppercase
products.Product clean(products.Product inrec) := TRANSFORM
  SELF.productName := Std.Str.ToUpperCase(inrec.productName);
  SELF := inrec;
END;

upperProducts := PROJECT(products.defaultView, clean(LEFT));
OUTPUT(upperProducts);
  • No labels