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 |
Hi any one has datasatge 8.5 certication dump could you please provide your details i will contact you. send reply to my mail rajaadivi@gmail.com Thanks in Advance
how do u convert date in 20-12-07 to dec-20-2007 or 20-dec- 2007 or 20-dec-07 in parallel
What are the third party tools you used in your project?
1.How to read multiple file from sequential stage. 2.If a file doesn't arrive or doesn't exists in sequential stage how do u handle this. 3.What do you do before taking data from source to staging area. 4. I have a remove duplicate stage and transformer stage.what will u do for optimizeing the performance of the job.
What are the different type of jobs in datastage?
How to exclude first and last lines while reading data into a sequential file(having some 1000 records).I guess probably by using unix filter option but not sure which to use
if i have two tables table1 table2 1a 1a,b,c,d 1b 2a,b,c,d,e 1c 1d 2a 2b 2c 2d 2e how can i get data as same as in tables? how can i implement scd typ1 and type2 in both server and in parallel? field1 field2 field3 suresh , 10,324 , 355 , 1234 ram , 23,456 , 450 , 456 balu ,40,346,23 , 275, 5678 how to remove the duplicate rows,inthe fields?
How a server job can be converted to a parallel job?
How do you start developing a datastage project?
for example You have One Table with 4 Columns (Mgr ID, Department ID, Salary, Employee ID). Can you find out the Average Salary and Number of Employee present per Department and Mgr
how to call sequential generator in datastage?
eno ename 1 qaz 1 wsx 1 edc 2 zxc 2 asd 3 qwe 3 wer 3 tru 4 rgj Output: eno ename count 1 qaz,wsx,edc 3 2 zxc,asd 2 3 qwe,wer,tru 3 4 rgj 1 I want the above output to be solved by DataStage as well and I have to write SQL query for the same output.