source file having the data like aabbccc, i want target file
result like a1a2b1b2c1c2c3.

Answers were Sorted based on User's Feedback



source file having the data like aabbccc, i want target file result like a1a2b1b2c1c2c3...

Answer / srinivas

We can do this with below major steps.

i)First split the data into rows each character as one row this can be done by below function in basic trnsformer

Convert(@TM,@FM,Fmt('aabbccddee', "1T"))

ii)Then next step take four stage variables in next transformer apply below logics

stg1----> Outputcolumn of first transfermer.

stg2----> 1

stge3----> if stg4=stg1 then stg3+1 else stg2

stg4----> stg1

stge5----> stg1:stge3

now we will get the below ansr

o/p column
a1
a2
b1
b2
c1
c2
d1
d2

iii)Then convert the rows into one single column.

Thanks
Srini

Is This Answer Correct ?    0 Yes 1 No

source file having the data like aabbccc, i want target file result like a1a2b1b2c1c2c3...

Answer / ramki

The same logic we can implement for as per the below Q


souce file having the columns like name company krish IBM
pooja TCS nandini WIPRO krish IBM pooja TCS if first row
will be repeat i want the result like this name company
count krish IBM 1 pooja TCS 1 nandini WIPRO 1 krish IBM 2
pooja TCS 2

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Data Stage Interview Questions

Please Tell me..,I need some Complex Jobs in datastage as per in interview?how to tell and how to explain?please send as well as posiible please

1 Answers   Systime,


What is the use of hoursfromtime() function in transformer stage in datastage?

0 Answers  


Is it possible to query a hash file?

0 Answers   IBM,


i have source like deptno,sal 1,2000 2,3000 3,4000 1,2300 4,5000 5,1100 i want target like target1 deptno,sal 1,2000 3,4000 4,5000 target2 2,3000 1,2300 5,1100 with out using transformerstage

6 Answers  


how can we join one oracle & flat files ?

2 Answers   ME,






what r the sources u need to create the datastage?

1 Answers  


Question 4) source target c1 c1 c2 c3 c2 c4 c4 c5 c3 c6 c7 c4 c5 c6 c7 Singal Source and Singal Target only subash,

3 Answers   TCS,


difference between server shared container and parallel shared container

6 Answers   CTS,


What are the functionalities of link collector?

0 Answers  


In aggregator stage,to find the sum of the entire group of columns,it displays in binary format. How can i solve this problem.

1 Answers   IBM,


there are two schemas x and y are there. some data is in x schema. i want to use that in y schema..how can i use? please give some possibilities

2 Answers   Wipro,


my source seq file have col1 1 2 3 4 5 6 7 8 9 i have 4 targets t1 t2 t3 t4 1 2 3 4 5 6 7 8 9 like this how we can get?

10 Answers   Polaris,


Categories