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...


I have a file it contain 2 records like empname,company as
Ram, Tcs and Ram, IBM. But i want empname,
company1,company2 as Ram, TCS,IBM in the target. How?

Answers were Sorted based on User's Feedback



I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empna..

Answer / subhash

The Simple way is:
SRCFile---->PIVOT Stage---->TGT
1. in PIVOT stage, select vertical PIVOT option.
2. specify the 'Array Size' as 2
3. select the 'Group by' check box for 'empname'
4. select the 'Pivot' check box for 'company'
then u will get the desired output.

Is This Answer Correct ?    11 Yes 1 No

I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empna..

Answer / venkatesh

The flow will be like this

src----->sorter---->transformer----->remove duplicates---->trg
SORTER
in sorter sort by the key=empname and create keychange column

TRANSFORMER
create two stage variables stg1 and stg2
if key change=1 then company else stg2 :',': company |stg1
_____________________________________________________|_____
|
stg1 |stg2

connect the stg1 as out put column and empname as output

from transformer connect to the remove duplicates
REMOVE DUPLICATES
key=empname
duplicates to retain=last
connect to the trg

u will get the output

Is This Answer Correct ?    5 Yes 1 No

I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empna..

Answer / cgi

Take sequential file and use sort stage and set keychange
column=true,put filter to output the data to two links, one
is kechange is 0 and other is for 1. first link is directly
goes to join stage and other stage should go to copy
stage.In the copy stage change the company column name to
company2 and populate to join. in the join stage provide
the key column to 'name' and do inner join. u will get
output as required.

Is This Answer Correct ?    0 Yes 2 No

I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empna..

Answer / tina

Use a lookup stage after the file. Do a self-lookup on this
file on empname. When the empname matches, take the empname
and company1 from stream link and company2 from reference
link and map to the target.

Is This Answer Correct ?    1 Yes 4 No

I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empna..

Answer / vinod upputuri

Venkatesh is Absolutely right but unfinished. After remove
duplicate stage we have to use either column import stage or
transformer stage.

SEQ>>>TRANS>>>REMOVEDUPLICATE>>>COLUMNIMPORT/TRANSFORMER>>>TARGET

if Transformer: use field function in derivation

for company1: field(company,',',1)
company2: filed(company,',',2)

for column import stage: specify the key column: company
default delimeter: ','
columns: company1 and company2

Is This Answer Correct ?    0 Yes 3 No

I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empna..

Answer / murali

Take the seq file stage and transformer and data set. in
transformer stage take two stage variables st1,st2 set the
intial value as '0' and data type is 'varchar' for st1
in st2 by using concatenate st1:',':st2

Is This Answer Correct ?    0 Yes 12 No

Post New Answer

More Data Stage Interview Questions

Differentiate between datastage and datastage tx?

0 Answers  


input Name Salay Sam 10 Sam 30 Sam 20 Ram 40 Ram 50 Output should be Name Salary Count Sam 10 3 Ram 40 2 get min salary and count of name . OutPut 2 Name Seq Sam 1 Sam 2 Sam 3 Ram 1 Ram 2

1 Answers   HCL,


What is the function in Transformer stage can act as Rank Function in oracle

1 Answers   Reliance,


What is a delta record? How you will read it?

0 Answers   EDS,


If you want to use the same piece of code in different jobs, how will you achieve it?

0 Answers  


I have load a Dataset in UAT with 2 Node configuration, imported the job into PROD environment which is 4 node configuration and using this DataSet as SRC to other job. will the job run fine or give any errors? If job runs fine, on how many nodes? 2 nodes or 4 nodes?

2 Answers   TCS,


What are some prerequisites for datastage?

0 Answers  


Can anyone tell me a difficult situation who have handled while creating Datastage jobs?

0 Answers   Cap Gemini, TCS,


Is there no issue when you try to convert a NOt null column in nullable and vice versa in aggregator styage and transformer stage? When I tried i got the warnings but in a running code I can see such type of scenarios. Please explain

2 Answers  


What is the flow of loading data into fact & dimensional tables?

0 Answers  


i 10 jobs first two jobs are runing in 2nodes,next 2 jobs are running in 4 nodes, next 4 jobs are running in 6 nodes and the remaining jobs are running on 10 nodes. how to change the node configuration?

2 Answers  


AGGREGATOR default datatype

0 Answers   CTS,


Categories