ECLIterate: Creates an ECL "ITERATE" definition.

Description Examples

Description

Creates an ECL "ITERATE" definition. The ITERATE function processes through all records in the recordset one pair of records at a time, performing the transform function on each pair in turn.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  ## Not run: 
    ecl1 <- ECL$new(hostName="192.168.217.128", port="8008")
    resType <- ECLRecord$new(name="rec_resType")
    resType$addField("INTEGER1", "Val")
    resType$addField("INTEGER1", "Rtot")
    ecl1$add(resType)
    
    dsRecords <- ECLDataset$new(name="ds_records", datasetType = resType, 
                    logicalFileName ="~ds::iterate", fileType="CSV")
    ecl1$add(dsRecords)
    
    iterate <- ECLIterate$new(name="ECLIterate", inDataset=dsRecords, 
                  outECLRecord=resType);
    iterate$addField("SELF.Rtot", "LEFT.Rtot+RIGHT.Val");
    iterate$addField("SELF", "RIGHT");
    ecl1$add(iterate)
    
    outputIterate <- ECLOutput$new(name="outputIterate", def = iterate$getName())
    ecl1$add(outputIterate)
    ecl1$print()
    
    xmlContent <- ecl1$execute()
    parseResults(xmlContent)
  
## End(Not run)

rHpcc documentation built on May 2, 2019, 11:04 a.m.

Related to ECLIterate in rHpcc...