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 is the best stage in datastage parller jobs to use full out join and why

5 Answers   Virtusa,


guys pls tell me where we use sequence jobs exactly in realtime proj explain pls with example.

2 Answers   TCS,


What are the difference types of stages?

0 Answers  


in aggregator , how can i get the sum in readable format

4 Answers   IBM,


cust id,cust quty like 1,101;1,102;1,103 i want output like cust id,cust quty 1 101,102,103 in oracle please write a query in oracle

3 Answers   TCS,






Define Merge?

0 Answers  


What is the Difference between Change capture stage and Difference Stage ? What are its significance individually ?

1 Answers  


Name the different sorting methods in datastage.

0 Answers  


IN SEQUENTIAL FILE,I HAVE DATA LIKE THIS EID,ENAME 11,AA 11,CC 22,DD 33,EE 22,AA 22,BB 22,CC 11,BB THEN i SELECT perform sort ON eid,uncheck both unique,stable AND I CHOOSE hash SORTING.WHAT IS THE OUTPUT I CAN GET.what happend if i select UNIQUE,STABLE. PLEASE EXPLAIN HOW THE RECORDS DISPLAY AT TARGET.

1 Answers  


how to closeing records after 10,000 records come?

3 Answers  


what will happen if we allow duplicates in datastage lookup abort drop record 1st value of duplicate record none

1 Answers   Wipro,


what is A Datastage?

2 Answers  


Categories