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

Define meta stage?

0 Answers  


What are the main differences you have observed between 7.x and 8.x version of datastage?

0 Answers  


how many types of sorting the data in data stage?

1 Answers   BoA, IBM,


how many write modes are there in ds

2 Answers   IBM,


1)s.key generate 1 to 700 records today. tomorrow another 400 will updated how to update the records using s.key generator? 2)source is like :-- DB --> T/F stage1 --> seq1file T/f 1 is linking with T/F2 ---> seq 2 how to load the data? in source i given some conditions those r going in seq1. The another data will going to seq2 how to do this ?

0 Answers   Wipro,






how can i get 2nd highest salary in datastage?can u send me ,thanQ 2)if i had source has 2 records 1st record ie 1st column contains 1,2,3 and 2nd coulmn contains 10,10,10 i have to get target as 2nd columns as 20,30,40 how can i?

3 Answers   Accenture,


What are the enhancements made in datastage 7.5 compare with 7.0?

0 Answers  


if i have two tables table1 table2 1a 1a,b,c,d 1b 2a,b,c,d,e 1c 1d 2a 2b 2c 2d 2e how can i get data as same as in tables?chandu how can i implement scd typ1 and type2 in both server and in parallel?chandu field1 field2 field3 suresh , 10,324 , 355 , 1234 ram , 23,456 , 450 , 456 balu ,40,346,23 , 275, 5678 how to remove the ,inthe fields?

2 Answers  


I have 2 jobs.I want to ru job B if job A has run 3 times.How can I achieve this through datastage

3 Answers   IBM,


i have a project manager round on sat this week can you post what are the main question i have to check.if you have any idea regular question on project pls send me. thanks in advance

2 Answers   IBM,


Hi friends, I am new to datastage, i have one query in datastage any one you please give reply to my post. I have a workbook (excel sheet) named as eg: xxxx, in that i have two tables emp(eid, ename, salary, deptno) and dep(deptno, name, state). in my source i have ODBC enterprise stage read the emp table and dept table join the two table and write the dept no 10(eid,ename,salary,name,state) values in target(). Thanks, Badari

0 Answers  


How can one find bugs in job sequence?

0 Answers  


Categories