1. A PRESENTATION ON TABLE
LOADER TRANSFORMATION
Prepared By
Kauhsal Solanki
2. WHAT IS TABLE LOADER TRANSFORMATION ???
The Table Loader transformation generates code that reads a
single source table (or view) and updates, replaces, or appends
it to a permanent target table.
One can have table loader in their job with the below step
mention.
Transformation
Access
Table Loader
3. WHAT ARE THE LOAD STYLES OF TABLE LOADER???
There are three types of load styles in table loader
which are mention below.
Replace
Append To Existing
Update/Insert
4. LOAD STYLE-REPLACE
It is a default load style in Table Loader Transformation.
There are basically three techniques are available with
Replace List.
• All Rows Using Delete
• Entire Table
• Simulating Truncate
6. LOAD STYLE-REPLACE WITH REPLACE OPTION
ENTIRE TABLE
When we are using Replace as load style, Entire Table is
a default Replace option.
It uses PROC DATASETS to delete all the target tables.
Here first all the rows are deleted and than data from
source data set is transferred to target data set.
7. LOAD STYLE-REPLACE WITH REPLACE OPTION
ENTIRE TABLE(CONTINUE)
Source Data Set(Customer)
ID
SURNAME
SALARY
1
Amar
Gohel
10000
2
Milan
Rana
20000
3
NAME
Marcel
Poul
30000
Target Data Set(CustomerInfo)
ID
NAME
SURNAME
GENDER
1
Amar
Gohel
M
2
Barbara
Willis
F
4
Vinay
Shah
M
8. LOAD STYLE-REPLACE WITH REPLACE OPTION
ENTIRE TABLE(CONTINUE)
After applying Table Loader Transformation with
Replace load style and entire table option as replace,
target dataset(CustomerInfo) is as below
ID
NAME
SURNAME
1
Amar
Gohel
2
Milan
Rana
3
Marcel
Poul
GENDER
9. LOAD STYLE-REPLACE WITH REPLACE OPTION ALL
ROWS USING DELETE
It uses pass-through sql with DELETE * to remove all rows
and then data from source dataset is transferred to target data
set.
It will give the same output as Entire Table Option as Replace
but it is using a different technique to delete the existing
source rows.
10. LOAD STYLE-REPLACE WITH REPLACE OPTION ALL
ROWS USING DELETE(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
11. LOAD STYLE-REPLACE WITH REPLACE OPTION ALL
ROWS USING DELETE(CONTINUE)
After applying Table Loader Transformation with
Replace load style and All Rows Using Delete option as
replace, target dataset(CustomerInfo) is as below
12. LOAD STYLE-REPLACE WITH REPLACE OPTION
SIMULATING TRUNCATE
It Uses a DATA step with SET and STOP statement to remove
all rows.
It will give the same output as Entire Table Option as Replace
and All Rows Using Delete but it is using a different
technique to delete the existing source rows.
13. LOAD STYLE-REPLACE WITH REPLACE OPTION
SIMULATING TRUNCATE(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
14. LOAD STYLE-REPLACE WITH REPLACE OPTION
SIMULATING TRUNCATE(CONTINUE)
After applying Table Loader Transformation with Replace
load style and Simulating Truncate option as replace, target
dataset(CustomerInfo) is as below.
15. FUNCTIONS OF DIFFERENT REPLACE OPTION
Replace
Description
All rows using delete
Uses pass-through sql with
DELETE * to remove all rows.
Entire Table
Replaces the entire table using
PROC DATASETS.
Simulating Truncate
Uses a DATA step with SET and
STOP statement to remove all rows.
16. LOAD STYLE-APPEND TO EXISTING
Here rows are added to the existing target table using PROC
APPEND or PROC SQL.
It has no techniques available for it.
So basically it is used when one has to only append the source
data to the destination dataset.
17. LOAD STYLE-APPEND TO EXISTING(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
18. LOAD STYLE-APPEND TO EXISTING(CONTINUE)
After applying Table Loader Transformation with Replace
load style and Simulating Truncate option as replace, target
dataset(CustomerInfo) is as below.
ID
NAME
SURNAME
GENDER
1
Amar
Gohel
M
2
Barbara
Willis
F
4
Vinay
Shah
M
1
Amar
Gohel
2
Milan
Rana
3
Marcel
Poul
19. LOAD STYLE-UPDATE/INSERT
It is different from other two, because it provides number of
different options.
Here it is require to specify a key column, in column(s) to
match portion.
It is necessary for Both dataset, source and destination to have
the key column
An important option which comes with Update/Insert is
Matching Rows.
21. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING SQL SET OPTION
Uses PROC SQL with a SET clause to perform the updates to
the target table.
In our example in columns match section we are defining ID
as matching column.
Let’s have an example for this option.
22. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING SQL SET OPTION(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
23. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING SQL SET OPTION(CONTINUE)
After applying Table Loader Transformation with
Update/Insert load style and SQL Set option within Matching
Rows section, target dataset(CustomerInfo) is as below.
ID
NAME
SURNAME
GENDER
1
Amar
Gohel
M
2
Barbara
Willis
F
4
Vinay
Shah
M
3
Marcel
Poul
24. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING MODIFY BY COLUMNS OPTION
It uses a DATA STEP with a MODIFY and a statement to
perform the update and insert to the target table.
In our example in columns match section we are defining ID
as matching column.
Let’s have an example for this option.
25. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING MODIFY BY COLUMNS OPTION(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
26. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING MODIFY BY COLUMNS OPTION(CONTINUE)
After applying Table Loader Transformation with
Update/Insert load style and Modify By Columns option
within Matching Rows section, target dataset(CustomerInfo)
is as below.
27. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING SKIP MATCHING ROWS OPTION
Ignores input rows that match rows in the target table only
inserts are performed.
In our example in columns match section we are defining ID
as matching column.
Let’s have an example for this option.
28. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING SKIP MATCHING ROWS OPTION(CONTINUE)
Source Data Set(Customer)
Target Data Set(CustomerInfo)
29. LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS
HAVING SKIP MATCHING ROWS OPTION(CONTINUE)
After applying Table Loader Transformation with
Update/Insert load style and Skip Matching Rows option
within Matching Rows section, target dataset(CustomerInfo)
is as below.
ID
NAME
SURNAME
GENDER
1
Amar
Gohel
M
2
Barbara
Willis
F
4
Vinay
Shah
M
3
Marcel
Poul
30. LOAD STYLE-UPDATE/INSERT
Matching Rows Option Function.
Matching Rows Option
Description
Skip Matching Rows
Ignores input rows that match rows
in the target table only inserts are
performed.
Modify By Columns
It uses a DATA STEP with a
MODIFY and a statement to
perform the update and insert to
the target table.
SQL Set
Uses PROC SQL with a SET
clause to perform the updates to
the target table.