Ab Initio Training
Basic Components
Filter By Expression
Filter by Expression
filters records
according to a DML
expression or
transform function,
which specifies the
selection criteria.
Filter by Expression
is sometimes used to
create a subset, or
sample, of the data.
Confidential ©2012 Syntel, Inc.
Filter By Expression
Ports:
Parameters
– in
select_expr
– out
– use_package
– deselect
– package
– reject
– error_group
– error
– log_group
– log
– reject-threshold
– logging
Confidential ©2012 Syntel, Inc.
> The Sort Component
Reads records from input port, sorts them by key, and writes
the result on the output port.
Confidential ©2012 Syntel, Inc.
> The Sort Component
Confidential ©2012 Syntel, Inc.
> The Sort Component
Input Data Outpu
t
Data
SOR
T
Confidential ©2012 Syntel, Inc.
> Keys
A key identifies a single field or set of fields (a composite
key) used to organize a dataset in some way.
Single field: {id}
Multiple field: {last_name; first_name}
Modifiers: {id descending}
Used for sorting, grouping, partitioning.
Note: Keys are also called collators.
Confidential ©2012 Syntel, Inc.
Dedup Sorted
Dedup Sorted separates one
specified record in each
group of records from the
rest of the records in the
group.
Dedup Sorted requires
grouped input.
Dedup Sorted component
removes duplicate records
from a sorted flow of data.
Perform a descending sort
or an ascending sort.
Confidential ©2012 Syntel, Inc.
Dedup Sorted
Ports:
Parameters
– in
key
– out
select
– dup
keep
– reject
package
– error
error_group
– log
log_group
– reject-threshold
– check-sort
– logging
Confidential ©2012 Syntel, Inc.
> The Reformat Component
Reads records from input port, reformats each according to a
transform function (optional in the case of the Reformat Component),
and writes the result records to the output (out0) port.
Additional output ports (out1, ...) can be created by adjusting the count
parameter.
Purpose : The Reformat component changes the
record format of data records by dropping fields, or
by using DML expressions to add fields, combines
fields, or transforms the data in the records.
Confidential ©2012 Syntel, Inc.
> The Reformat Component
Count : is an integer from 1 to 20 that is used to set the number
of the following ports
out ports
reject ports
error ports
transform parameters
Transform : used for mapping purpose (From source to Target)
based on the business requirement.
Select : is used to filter data records based on a select
expression. Same as Filter by Expression
Confidential ©2012 Syntel, Inc.
> The Reformat Component
Count : is an integer from 1 to 20
that is used to set the number of
the following ports
out ports
reject ports
error ports
transform parameters
Confidential ©2012 Syntel, Inc.
> Built In Functions in Reformat or any Transform Component
Inquiry and Error Functions : Math Functions :
String Functions : Date Functions :
fail_if_error ceiling
string_compare date_add_months
first_defined decimal_round
string_concat date_day
force_error floor
string_downcase date_day_of_month
is_defined math_abs
string_filter date_day_of_year
is_error math_acos
string_length date_month
is_failure math_asin
string_lpad date_to_int
is_null math_atan
string_replace date_month_end
is_valid math_cos
is_blank date_year
length_of math_exp
string_ltrim datetime_add
size_of math_pow
string_pad now
today write_to_log math_sin
string_trim
today1 math_sinh
string_upcase
math_sqrt
math_tan
math_tanh
Confidential ©2012 Syntel, Inc.
> The Reformat Component
Target Fields
Source Fields Transformation Rules
Transform : used for mapping purpose (From source to
Target) based on the business requirement.
Confidential ©2012 Syntel, Inc.
> Text DML: Transform Function Syntax
Transform Functions look like:
output-variables :: name ( input-variables ) =
begin
assignments;
end;
Assignments look like:
output-variable.field :: expression;
Confidential ©2012 Syntel, Inc.
> The Transform Function in Text Format
out :: reformat (in) =
begin
out.id :: in.id + 1000000;
out.last_name :: string_concat(“Mac”, in.last_name);
end;
Confidential ©2012 Syntel, Inc.
> A Look Inside the Reformat Component
a b c
x y z
Confidential ©2012 Syntel, Inc.
> The Record is read into the component
9 45 AB
out :: reformat(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: string_concat(in.c,”C”);
end;
Confidential ©2012 Syntel, Inc.
> The Transformation Function is evaluated
9 45 AB
out :: reformat(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: string_concat(in.c,”C”);
end;
Confidential ©2012 Syntel, Inc.
> Since every rule within the Transform function, is successful, a result record is
issued
out :: reformat(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: string_concat(in.c,”C”);
end;
44 9 ABC
Confidential ©2012 Syntel, Inc.
> The result record is written to the output port of the component
out :: reformat(in) =
begin
out.x :: in.b - 1;
out.y :: in.a;
out.z :: string_concat(in.c,”C”);
end;
44 9 ABC
Confidential ©2012 Syntel, Inc.
> Exercise: Write the transformation rules for the below given
scenario
Input record format:
0345,090263John,Smith;
0345,090263John,Smith;
record
decimal(”,”) id;
date(”MMDDYY”) bday;
string(”,”)first_name;
string(”;”) last_name;
Drop Reformat end
Reformat Reorder
id+1000000
Output record format:
record
decimal(7) id;
string(8) last_name;
date(”YYYY.MM.DD”) bday;
end
1000345Smith
1000345Smith 1963.09.02
1963.09.02
Confidential ©2012 Syntel, Inc.
> The Replicate Component
Purpose : This component arbitrarily
combines all the data records it receives into
a single flow and writes a copy of that flow
to each of its output flows.
Confidential ©2012 Syntel, Inc.
> The Replicate Component
Copy data into 2 flows Output Sorted on Field ID
Output Sorted on
Field first_name
Confidential ©2012 Syntel, Inc.
Thank You!
Confidential ©2012 Syntel, Inc.