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 difference between server job and parallel jobs?

686


Define oconv () and iconv () functions in datastage?

901


How to RD using transformer?

880


What is the command line function to import and export the ds jobs?

696


What are the enhancements made in datastage 7.5 compare with 7.0?

726






What are the different plug-ins stages used in your projects?

639


What is merge stage?

782


What are stage variables and constants?

722


What is orabulk stage?

661


What is the purpose of pivot stage?

620


What is data partitioning?

761


Triggers,VIEW,Procedures

817


What are system variables and sequencers in datastage

622


What is difference between server jobs & parallel jobs?

643


How to perform incremental load in datastage?

692