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
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 |
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 |
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 |
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 |
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 |
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 |
What are the different common services in datastage?
Tell me Wt main advantage of Stage varibles? Project level hints?
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.
What is RCP
Anyone has Datastage certification free dumps for 000-418 , 000-421 codes, mail me @ manik.dwh@gmail.com 000-418 : InfoSphere DataStage v8.0 000-421 : InfoSphere DataStage v8.5
specify data stage strength?
1.i have 5 jobs(1-5),i connect with each other,i want run from 3-5 only how? 2.how to schedual the job in datastage7.5 2? what is the deff bet grip and fgrep command? how do you cleanse the data in your project
Hi , Today 1000 records updated, tomorrow 500 records updated how to find that?
What is quality stage?
what is diff b/w datastage 8.1,8.5,8.7?
how to sort two columns in single job in datastage.
which cache supports connected & un connected Lookup