in datastage interview qustion
source target
------- -------
12345 1
2
3
4
5
Answers were Sorted based on User's Feedback
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 |
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 |
how can u handle null values in transformer stage.
Which commands are used to import and export the datastage jobs?
Differentiate between odbc and drs stage?
SOURCE LIKE I_D,F1,F2 --------- 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 O/P LIKE ID flag1 flag2 101 Y Y 101 N Y 102 Y N 102 N Y 104 Y Y 106 N Y
Explain usage analysis in datastage?
What are the types of containers and how to create them?
Triggers,VIEW,Procedures
Does datastage support slowly changing dimensions ?
1)Source file contains one record, I want 100 records in target file.
What are orabulk and bcp stages?
Can aggregator and transformer stages use to sort the data? How ?
how to sort two columns in single job in datastage.