Many thanks for visiting my Blog..!!Please share this blog using below share buttons and leave your Comments/Feedback/Appreciations on Tab: Feedback
Share This Blog..!!

Datastage Scenario Based Question/Answer : 2

Datastage Scenario Based Question/Answer : 2
Without a key column,Pivoting the Output data in Required Format.

Input Data :
NAME
-----------
IBM
WEBSPHERE
DATASTAGE
IBM
INFOSPHERE
DATASTAGE
Required Output
NAME
----------
IBM WEBSPHERE DATASTAGE
IBM INFOSPHERE DATASTAGE

Solution:
=======

One of the way to solve this problem is :
Source=> Transformer=> Pivot Enterprise stage (Horizontal)/Transformer=> Target
1. Read the Source Data.
2. Col1=> SeqNo => 
Derivation (If @INROWNUM <=3 then 1 Else (Floor( (@INROWNUM - 1) /3) + 1)) 
3. Col2=> Name
4. You will get data like this
SeqNo | Name
1|IBM
1|WEBSPHERE
1|DATASTAGE
2|IBM
2|INFOSPHERE
2|DATASTAGE
5. Then use Vertical pivoting using Pivot Enterprise stage.Pivot the data based on SeqNo column. Or you can use Transformer Looping concept as well.
6. Pass the data to target.
You will get the output in required format.

Other Scenario Based Questions You May Like :

No comments:

Post a Comment

disqus