Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


In the source seq file have 2 columns, i.e
input:
col1,col2
1,1
2,rajesh
3,15000
4,2
5,suresh
6,16000
7,3
8,veeru
9,17000

I want in the output like:
eno,ename,sal
1,rajesh,15000
2,suresh,16000
3,veeru,17000

any one answer this scenario

Answers were Sorted based on User's Feedback



In the source seq file have 2 columns, i.e input: col1,col2 1,1 2,rajesh 3,15000 4,2 5,sures..

Answer / subhash

SRC--->TFM--->PIVOT----> TGT

In TFM, use below logic
col1 MOD 3----->col1
then out from TFM is:
col1,col2
1,1
2,rajesh
0,15000
1,2
2,suresh
0,16000
1,3
2,veeru
0,17000
In PIVOT, do vertical PIVOT, group by column is 'col1' and pivot column is 'col2' then we will get desired output.

Is This Answer Correct ?    5 Yes 1 No

In the source seq file have 2 columns, i.e input: col1,col2 1,1 2,rajesh 3,15000 4,2 5,sures..

Answer / subhash

SRC--->TFM--->PIVOT----> TGT

In TFM, use below logic
if col1<4 then 1 elseIf col1>3 AND col1<7 then 2 else 3-----
>col1
then out from TFM is:
col1,col2
1,1
1,rajesh
1,15000
2,2
2,suresh
2,16000
3,3
3,veeru
3,17000
In PIVOT, do vertical PIVOT, group by column is 'col1' and
pivot column is 'col2' then we will get desired output.

Is This Answer Correct ?    3 Yes 0 No

In the source seq file have 2 columns, i.e input: col1,col2 1,1 2,rajesh 3,15000 4,2 5,sures..

Answer / bharath

if inputlnk.col1%3= 1 then outputlnk.col1=inputlnk.col2
else inputlnk.col2


if inputlnk.col1%3= 2 then outputlnk.col2=inputlnk.col2
else inputlnk.col2

if inputlnk.col1%3= 0 then outputlnk.col3=inputlnk.col2
else inputlnk.col2

use above conditions in transformer stage
and then
change the column names using modify stage
as col1 = eno
col2 = ename
col3 = sal

let me know right answer, if i'm wrong...
..

Is This Answer Correct ?    3 Yes 5 No

Post New Answer

More Data Stage Interview Questions

How do you register plug-ins?

0 Answers  


in job of 30 one job is very slow due to this entire job is very slow how can u know which job is slow?

0 Answers   IBM,


How to perform incremental load in datastage?

0 Answers  


In the source seq file have 2 columns, i.e input: col1,col2 1,1 2,rajesh 3,15000 4,2 5,suresh 6,16000 7,3 8,veeru 9,17000 I want in the output like: eno,ename,sal 1,rajesh,15000 2,suresh,16000 3,veeru,17000 any one answer this scenario

3 Answers  


I am defining one varaible parameter date in job parameters.I want use this variable date in where clause in source query.

2 Answers   TCS,


i have seq file that contents 10 million records load to target any data base.. in that case it takes lot of time for loading..how do performance tuning in that situation...?

5 Answers   TCS,


How and where you used hash file?

0 Answers  


project Steps,hits, Project level HArd things,Solved methods?

0 Answers   Hexaware,


How to read multiple files at different directories using a single Sequential File stage in DS Enterprise Edition

6 Answers   TCS,


whats difference between ls -ltr and ls -lrt?

5 Answers   L&T,


country, state 2 tables r there. in table 1 have cid,cname table2 have sid,sname,cid. i want based on cid which country's having more than 25 states i want to display?

3 Answers   Wipro,


Emp login_timestamp Logout_timestamp A,2019-02-01 02:24:15,2019-02-01 04:59:42 B,2019-03-29 14:43:30,2019-03-29 20:22:00 ABC,2019-03-29 12:43:00,2019-03-29 23:22:59 In the above calculate the duration of hours spent in office for each emp in datastage.

1 Answers  


Categories