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

sed,awk,head

971


What is the process of killing a job in datastage?

594


What are the types of jobs we have in datastage?

673


On which interface you will be working as a developer?

639


What is oci?

858






What is the flow of loading data into fact & dimensional tables?

600


Why we use surrogate key?

701


What is the sortmerge collector?

668


how to sort two columns in single job in datastage.

2536


Hi everyone,I have kept a project Sales And Distribution for a pharmaceutical company.can anybody explain one complex business rule that we had in our project and how did you accomplish it using DS?

1765


What are the partitioning techniques available in link partitioner?

1757


What are the different type of jobs in datastage?

608


How rejected rows are managed in datastage?

925


What is usage analysis in datastage?

820


What all are the different way to run a job?

643