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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the importance of the exception activity in datastage?

869


Can you implement SCD2 using join, transformer and funnel stage?

1339


how to get sum of sal based on dept_no and then sum of all sal irrespective of dept_no in same sql. output:- 10, 200(sum of sal for dept_no 10), 5000(sum of all sal)

728


what should be ensure to run the sequence job so that if its get aborted in 10th job before 9job should get succeeded?

1178


what is repositery?

1574


Differentiate between Symmetric Multiprocessing and Massive Parallel Processing?

921


Differentiate between odbc and drs stage?

827


What is the purpose of pivot stage?

870


Field,NVL,INDEX,REPLACE,TRANSLATE,COLESC

1203


disign the complex job in u r project?(they are aksing only complex job design and then data flow...)

2281


How will you move hashed file from one location to another location?

1916


Describe routines in datastage? Enlist various types of routines.

802


What are the types of views in datastage director?

1560


How do you generate sequence number in datastage?

866


Define Data Stage?

871