Professional Documents
Culture Documents
Scan with rollup as the names implies that it functions both as rollup and scan component i.e,
from the out port we get the cumulative summary of the input record for the group it belongs
as scan component and from the rollup component we get the summary of the input group in
the output record.
Sorted-input: There are 2 values for this parameter. When set to “Input must be sorted or
grouped”, the component requires grouped inputs which are sorted. This is the default option
for this parameter. When set to “In-memory: Input need not be sorted”, the component
accepts ungrouped input and it requires use of max_core parameter.
Key-method: Method by which component group records. There are 2 options for this
parameter.
Use Key Specifier
Use Key_change function
Key: Name of the key fields, that the component will use to group records are mentioned
here. This parameter is available only when Key method parameter is set as “Use Key
specifier”.
Max-core: Maximum memory usage in bytes. Default is 10MB.
Check-sort: If you use a key specifier, this parameter indicates whether or not to abort
execution on the first input record that is out of sorted order.
Transform: The name of the file containing the types and transform functions, or a transform
string.
Logging: Specifies whether or not to log component events.
Sample Graph
Example 1
To Assign sequence Number & cumulative sum from Scan output port and
the sum fo each cust_id group from rollup output:
Input
record
decimal("|") cust_id;
string("|") cust_name;
decimal("|") bill_no;
decimal("\n") amount;
end
Code in Transform
type temporary_type=record
decimal(4) SeqNo;
decimal(8) Sum;end; /*Temporary variable*/
temp :: initialize(in) =
begin
temp.SeqNo :: 0;
temp.Sum :: 0;
end;
Output
Scan Output port
record
decimal("|") Sno;
decimal("|") cust_id;
string("|") cust_name;
decimal("|") bill_no;
decimal("|") amount;
decimal("\n") Total_amount;
end
Example 2
To show key_change function:
Input
record
decimal("|") cust_id;
string("|") cust_name;
decimal("|") bill_no;
decimal("\n") amount;
end
Code in Transform:
type temporary_type=record
decimal(4) SeqNo;
decimal(8) Sum;end; /*Temporary variable*/
temp :: initialize(in) =
begin
temp.SeqNo :: 0;
temp.Sum :: 0;
end;
Output
Scan Output port
record
decimal("|") Sno;
decimal("|") cust_id;
string("|") cust_name;
decimal("|") bill_no;
decimal("|") amount;
decimal("\n") Total_amount;
end
*******************************************************************