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

how to connect source to db?generally what r stages u used? how to find the data is having delimiter format?

0 Answers   Wipro,


how to retrive the max(sal),deptno,empno in datastage?

13 Answers   Polaris,


Which type of joins Merge stage can support?

7 Answers   IBM,


when we will use connected Lookup & Unconnected Lookup

3 Answers   Wipro,


What is container and then types?

1 Answers  






What is PX?

2 Answers   IBM,


How do u view log file for a particular job?

6 Answers   HP,


Describe stream connector?

0 Answers  


how can u connect the client system directly at any time?

1 Answers   IBM,


for example You have One Table with 4 Columns (Mgr ID, Department ID, Salary, Employee ID). Can you find out the Average Salary and Number of Employee present per Department and Mgr

0 Answers  


HOW CAN U DO ERROR HANDLING IN DATA STAGE?

8 Answers   ME,


How can we perform the 2nd time extraction of client database without accepting the data which is already loaded in first time extraction?

0 Answers   Reliance,


Categories