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

Is there any possibility to generate alphanumeric surrogate key?

3 Answers   ABC, IBM,


How do you load dimension data and fact data? Which is first

2 Answers  


In which situations we can use normal and sparse lookup stages

4 Answers   IBM,


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

2 Answers  


What is difference between join, merge and lookup stage?

0 Answers  


Main Function of the Staging area in DWH ?

2 Answers  


What are constraints and derivations?

0 Answers  


What are routines in datastage?

0 Answers  


Hi Vijay here For Four CPU's how many nodes will required?

4 Answers   TCS,


What is mapping?

3 Answers  


What is size of a transaction and an array means in a datastage?

0 Answers  


Can we use sequential file as source to hash file? Have you do it ?if what error it will give?

1 Answers   SS Solutions,


Categories