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

What are the components of datastage?

0 Answers  


how to use self join using datastage ? can u tell me using stage how can we implemnet the self join

0 Answers  


How can you join flat file, oracle as a sources?

4 Answers   IBM,


Is the value of staging variable stored temporarily or permanently?

0 Answers  


Difference between sequential file and data set?

0 Answers  






How much data u can get every day? 2)which data ur project contains? 3) what is the source in ur project?what is the biggest table & size in ur schema or in ur project?

2 Answers   Wipro,


What are the types of containers?

0 Answers  


What are the types of views in datastage director?

0 Answers  


What are the important features of datastage?

0 Answers  


source 1123445 I WANT OUTPUT AS DUPLICATES TO TARGET1 LIKE TARGET1 1144 NON-DUPLICATES TO TARGET2 TARGET2 235

6 Answers   US Technology,


How do you load 10 different sources with 10 different layouts to 10 different tables?

1 Answers   TIAA CREF,


in source is like seq file in date column have dd-mm-yy dddd-mmmm-yyyy mm-dd-yy yy-dd-mm yy-mm-dd i want to display only yy-dd-mm date formats only in tgt?

2 Answers   Wipro,


Categories