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

hi my source is:: empno,deptno,salary 1, 10, 3.5 2, 20, 8 2, 10, 4.5 1, 30, 5 3, 10, 6 3, 20, 4 1, 20, 9 then target should be in below form... empno,max(salary),min(salary),deptno 1, 9, 3.5, 20 2, 8, 4.5, 20 3, 6, 4, 10 can anyone give data flow in data stage for the above scenario.... thanks in advance...

5 Answers  


What is the Difference between Change capture stage and Difference Stage ? What are its significance individually ?

1 Answers  


What is the importance of the exception activity in datastage?

0 Answers  


how to find diff between 2 dates without using Icon... funtions?

1 Answers  


Define project in datastage?

0 Answers  






Hi All , in PX Job I have passed 4 Parameters and when i run the same job in sequence i dont want to use those parameters , is this possible if yes then how

0 Answers   TCS,


what is advantages of snowflake when it is used?

3 Answers   IBM,


how to add a new records into source?

0 Answers  


i have input like this Column 1 ,column 2 3,a 4,b 5.c i want output  aaa bbbb ccccc Ple help any one?

4 Answers   SLK Software,


Explain the datastage parallel extender (px) or enterprise edition (ee)?

0 Answers  


Create a job to load all unique products in one table and the duplicate rows in to another table. The first table should contain the following output A D The second target should contain the following output B B B C C Q2. Create a job to load each product once into one table and the remaining products which are duplicated into another table. The first table should contain the following output A B C D The second table should contain the following output B B C

3 Answers   Deloitte, IBM,


How to LOG 'unmatched Master' records and 'Reject Updates' in log files using MERGE stage?

1 Answers   TCS,


Categories