Open topic with navigation
Retaining only every nth record can be implemented in DMExpress in the following ways:
Retaining every 3rd record of the following source data would result in the subsequent target data:
This can be done in DMExpress in either of the following ways:
Using this method, a target record number is added to the output file in the first task, and a filter is added to the output file based on the target record number in the second task. A two-task solution is required as the target record number cannot be used in the filter of the first task.
Mod(recordlayout_output_task1.TargetRecordNumber,3) = 0
This provides the best performance by passing the data between tasks in memory, avoiding disk I/O writes, and allowing the tasks to run in parallel.
In this method, a user-defined value keeps track of the record number, and the data is filtered based on that counter value.
isCounterInitialized=GetUserDefinedValue("counter") != ""
This condition checks if a user-defined value called counter has been initialized. It returns 1 if the counter is initialized and 0 otherwise.
incrementRecordNumber=SetUserDefinedValue("counter",ToNumber(getRecordNumber) + 1)
Mod(recordlayout_output_task1.recordNumber,3) = 0
51_TargetRecordNum.zip, compatible with DMExpress version 6 or higher
For more information on the Mod function and its usage, see Mod function in the DMExpress Help.
For more information on direct data flows and how they impact performance, see Direct data flows and performance in the DMExpress Help .
Copyright © 2016 Syncsort All rights reserved.