I/P

---



ID Value

1 AB
2 ABC
3 ADE
4 A

O/p
---
ID Value
1 A
1 B
2 A
2 B
2 C
3 A
3 D
3 E
4 A

Answers were Sorted based on User's Feedback



I/P --- ID Value 1 AB 2 ABC 3 ADE ..

Answer / subbuchamala

SRC-->TFM--->TGT
in TFM, Use Stage variables and Loop variables as below:

StageVar-->Len(Lnk.Value)===>this will give length of string of "Value" column. i.e.,
ID Value StageVar

1 AB 2
2 ABC 3
3 ADE 3
4 A 1

Next, in the Loop variable part:
Loop While==> @ITERATION<= StageVar
For each input row, Loop will repeat until "Value" length finishes.

Add new Loop variable-->LoopVar and put below derivation:
Left(lnkCstIPSGMSPread.IJABL, @ITERATION)-->LoopVar

Next, in the Output Col Derivation:
Lnk.ID-->ID
LoopVar-->Value

Finally, you will required Output.

Is This Answer Correct ?    4 Yes 0 No

I/P --- ID Value 1 AB 2 ABC 3 ADE ..

Answer / mohanasam

please clarify the answer? Vinod

Is This Answer Correct ?    0 Yes 1 No

I/P --- ID Value 1 AB 2 ABC 3 ADE ..

Answer / upputuri.vinod

first of all we have to split the value into individual char
value(1,1) v(2,2) v(3,3)
c1 c2 c1 c2 c3 c4
1 AB 1 A B
2 ABC---> 2 A B c----> pivot--->o/p
3 ADE 3 A D E
4 A 4 A

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More Data Stage Interview Questions

Define repository tables in datastage?

0 Answers  


how to abort the job its matain duplicates?

0 Answers   TCS,


how can or from where we can get reference data in scd type2 implementation?

2 Answers   JPMorgan Chase,


Unix Qn asked in datastage interview: I have diff type(.txt, .tmp, .bat etc) of file in 4 diff directories, I want move all '.txt' file from 4 directories to other folder. And need to delete all the files except which are created TODAY?

2 Answers   TCS,


If you want to use a same piece of code in different jobs, how will you achieve this?

0 Answers  






What is the Main difference between Lookup Failure and Lookup Not Met? Plz explain with Example.

2 Answers  


plz tell me some dimentional and fact table names in banking project?

2 Answers   Virtusa,


what is materialized view used datastage?

1 Answers   HSBC,


Drop duplicate records ... SOURCE LIKE .......... ID flag1 flag2 100 N Y 100 N N 100 Y N 101 Y Y 101 N Y 102 Y N 103 N N 104 Y Y 105 N N 106 N Y 102 N Y 105 Y Y in above file if any id having both the flags as "N" then that corresponding id records should be dropped, in above case o/p should be as ID flag1 flag2 101 Y Y 101 N Y 102 Y N 102 N Y 104 Y Y 106 N Y Steps to do : 1) Identified the id’s that got duplicated (both the flag values having vales “N”) 2) Look up with these id’s to existing id’s to drop .

2 Answers  


Name the different sorting methods in datastage.

0 Answers  


source file having the data like aabbccc, i want target file result like a1a2b1b2c1c2c3.

2 Answers  


How to Convert the columns into rows?

2 Answers  


Categories