Datastage scenario - two columns in the source

I have two columns in the source , COl A and Col B .
Input is like
Cola Colb
I should achieve the output as
Cola Colb
100 A
100 B
100 C
100 D
100 E
100 F
Note : Colb is not of fixed length .

Showing Answers 1 - 3 of 3 Answers


  • Nov 11th, 2014

Hi Srav,

Use loop variable in Transformer
write condition @iteration<=6
Now write a looopvariable lpvar1 like
if @iteration=1 then left(input,1)
if @iteration=2 then Right(left(input,2),1)
like that till @iteration =6

Map this to the output column.

I think this will work.
If it works donate to save my city hit by hudhud cyclone

  Was this answer useful?  Yes


  • Nov 25th, 2014

use pivot stage

  Was this answer useful?  Yes


  • Jan 7th, 2015

Its pretty much easy using loop.

With below loop conditions in transformer.You can easily achieve it

Loop Condition: @ITERATION <= Len(DSLink2.COLB) --Loop will end when the length of the string hits.

Derivation: Right(Left(DSLink2.COLB, @ITERATION),1) --Right & Left functions will extract characters

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions