A presentation on table loader transformation

31
A PRESENTATION ON TABLE LOADER TRANSFORMATION Prepared By Kauhsal Solanki

description

Presentation On Table Loader Transformation In a SAS Data Integration Tool.

Transcript of A presentation on table loader transformation

Page 1: A presentation on table loader transformation

A PRESENTATION ON TABLE LOADER TRANSFORMATION

Prepared By

Kauhsal Solanki

Page 2: A presentation on table loader transformation

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

Page 3: A presentation on table loader transformation

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

Page 4: A presentation on table loader transformation

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

Page 5: A presentation on table loader transformation

HERE WHAT IT’S BASICALLY LOOKS LIKE

Page 6: A presentation on table loader transformation

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.

Page 7: A presentation on table loader transformation

LOAD STYLE-REPLACE WITH REPLACE OPTION ENTIRE TABLE(CONTINUE)

Source Data Set(Customer)

Target Data Set(CustomerInfo)

ID NAME SURNAME SALARY

1 Amar Gohel 10000

2 Milan Rana 20000

3 Marcel Poul 30000

ID NAME SURNAME GENDER

1 Amar Gohel M

2 Barbara Willis F

4 Vinay Shah M

Page 8: A presentation on table loader transformation

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 GENDER

1 Amar Gohel

2 Milan Rana

3 Marcel Poul

Page 9: A presentation on table loader transformation

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.

Page 10: A presentation on table loader transformation

LOAD STYLE-REPLACE WITH REPLACE OPTION ALL ROWS USING

DELETE(CONTINUE)

Source Data Set(Customer)

Target Data Set(CustomerInfo)

Page 11: A presentation on table loader transformation

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

Page 12: A presentation on table loader transformation

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.

Page 13: A presentation on table loader transformation

LOAD STYLE-REPLACE WITH REPLACE OPTION SIMULATING TRUNCATE(CONTINUE)

Source Data Set(Customer)

Target Data Set(CustomerInfo)

Page 14: A presentation on table loader transformation

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.

Page 15: A presentation on table loader transformation

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.

Page 16: A presentation on table loader transformation

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.

Page 17: A presentation on table loader transformation

LOAD STYLE-APPEND TO EXISTING(CONTINUE)

Source Data Set(Customer)

Target Data Set(CustomerInfo)

Page 18: A presentation on table loader transformation

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

Page 19: A presentation on table loader transformation

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.

Page 20: A presentation on table loader transformation

LOAD STYLE-UPDATE/INSERT(CONTINUE…)

Matching Row contains basically three options within it, which are mention below.

Skip Matching Rows

Modify By Columns

SQL Set

Page 21: A presentation on table loader transformation

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.

Page 22: A presentation on table loader transformation

LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SQL SET OPTION(CONTINUE)

Source Data Set(Customer)

Target Data Set(CustomerInfo)

Page 23: A presentation on table loader transformation

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

Page 24: A presentation on table loader transformation

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.

Page 25: A presentation on table loader transformation

LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING MODIFY BY COLUMNS OPTION(CONTINUE)

Source Data Set(Customer)

Target Data Set(CustomerInfo)

Page 26: A presentation on table loader transformation

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.

Page 27: A presentation on table loader transformation

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.

Page 28: A presentation on table loader transformation

LOAD STYLE-UPDATE/INSERT WITH MATCHING ROWS HAVING SKIP MATCHING ROWS OPTION(CONTINUE)

Source Data Set(Customer)

Target Data Set(CustomerInfo)

Page 29: A presentation on table loader transformation

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

Page 30: A presentation on table loader transformation

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.

Page 31: A presentation on table loader transformation

THANK YOU