in datastage interview qustion

source target
------- -------
12345 1
2
3
4
5

Answers were Sorted based on User's Feedback



in datastage interview qustion source target ------- ---..

Answer / subbuchamala

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

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

Source StageVar
12345 5


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

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

Next, in the Output Col Derivation:

LoopVar-->Target
Ex:
For 1st ITERATION: Left("12345", 1)==>1
For 2nd ITERATION: Left("12345", 2)==>2
....
....
Finally, you will required Output.

Is This Answer Correct ?    2 Yes 1 No

in datastage interview qustion source target ------- ---..

Answer / np

Use Pivot stage

Is This Answer Correct ?    1 Yes 1 No

in datastage interview qustion source target ------- ---..

Answer / lajpat kurdiya

SELECT SUBSTR(12345,LEVEL,1) AS Source
FROM DUAL
CONNECT BY LEVEL <= LENGTH(12345);


SELECT SUBSTR('12345',LEVEL,1) AS Source
FROM DUAL
CONNECT BY LEVEL <= LENGTH('12345');

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Stage Interview Questions

how to use self join using datastage ? can u tell me using stage how can we implemnet the self join

0 Answers  


If we take 2 tables(like emp and dept),we use join stage and how to improve the performance?

0 Answers  


is it possible to access the same job by two users at a time in DataStage?

2 Answers   IBM,


how to design the change capture stage in(data stage parallel jobs) type 2

2 Answers   IBM,


In my project source data comes from MAINFRAME in files.so,This time data is coming as a binary file...I know for binary data we use Complex flat file stage..I have used it also..but on 'view data' data is not coming correctly..as it in MAINFRAME.give me some ideas..

2 Answers  






How a source file is populated?

0 Answers  


i want send my all duplicate record one tar and all uniq records one target how we will perfome explain example: input data eid 251 251 456 456 951 985 out put/target1 251 251 456 456 out put/target2 951 985 how we will bring

13 Answers   Bank Of America, IBM,


it is possible to load two tables data into one sequential file?if possible how?plz share with me?

6 Answers   TCS,


difference between function and procedure...

1 Answers   IBM,


what is a message handler

3 Answers   IBM,


in sequtial file 2 columns avaliable,iwant only one column load the target how do it.

10 Answers   Wipro,


Define repository tables in datastage?

0 Answers  


Categories