ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Data Warehouse >> Data Stage
 
 


 

 
 Teradata interview questions  Teradata Interview Questions (183)
 Business Objects interview questions  Business Objects Interview Questions (751)
 Cognos interview questions  Cognos Interview Questions (842)
 Informatica interview questions  Informatica Interview Questions (1622)
 Crystal Enterprise Suite interview questions  Crystal Enterprise Suite Interview Questions (29)
 Actuate interview questions  Actuate Interview Questions (35)
 Ab Initio interview questions  Ab Initio Interview Questions (168)
 Data Stage interview questions  Data Stage Interview Questions (563)
 SAS interview questions  SAS Interview Questions (550)
 Micro Strategy interview questions  Micro Strategy Interview Questions (35)
 ETL interview questions  ETL Interview Questions (195)
 Data Warehouse General interview questions  Data Warehouse General Interview Questions (215)
Question
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


 Question Submitted By :: Data-Stage
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
first sort the both name and compamy and then,
using stage variable in transformer:
curr= name:company
val=if curr <> prev then 1 else val+1
prev=curr

o.p = val
name,company,val
 
Is This Answer Correct ?    6 Yes 2 No
Disney
 
Answer
# 2
use transforemr stage and give three stage variable with intial value as 0,
then give (if company=ibm then count=count+1 else stgvar1)
like give three conditions for remaing two companies in two stage variables)
and in column derivation give if company=ibm then stgvar1 else
if company=wipro then stgvar2 else if company=tcs then stgvar3 else 0(company not in list)
 
Is This Answer Correct ?    7 Yes 5 No
Shasank, Pr3systems
 
 
 
Answer
# 3
Just modified the last post with minor changes

First sort the both name and compamy and then,
using stage variable in transformer:
sv1= name:company
sv3=if sv1=sv2 then sv3+1 else sv3(initial value of sv3=1)
sv2=sv1(initial value of sv2 =XXXXXXX)

OP

name company count=sv3
 
Is This Answer Correct ?    3 Yes 2 No
Pushparaj
 
Answer
# 4
Use below stage variables

create 4 stage variables

STG1 =NAME:COMPANY

STG2=1

STG3= IF STG1:STG4 THEN STG3+1 ELSE STG2

STG4= STG1

create extra column for store this ranks.


After this stage use the sort stage to sort the data based on ranking column.

Then will get the exact output what we are looking.

krish IBM 1
pooja TCS 1
nandini WIPRO 1
krish IBM 2
pooja TCS 2
 
Is This Answer Correct ?    1 Yes 0 No
Srinivas
 
Answer
# 5
use aggregator stage take count(*) group by name 
Is This Answer Correct ?    1 Yes 0 No
Sankar
 
Answer
# 6
Hi ALL,

Job Design:

SourceSeqFile--->SortStage--->Transformer--->TgtSeqFile

1. In Sort Stage, take two key, name & company and then go
to options and create a keyChange column.
2. In transformer stage, create a stage variable of integer
type (say Var1) and write in it's derivation:
if keyChange=1 then 1 else Var1+1
3. Now create a new column in tgt (say count) and in
transformer, assign that Var1 to the derivation of count.
4. Goto o/p tab of transformer and there sort the data on
count column.
You'll get the desired output.

If you have more queries, you can mail me on
ankitgosain@gmail.com

Cheers,
Ankit :)
 
Is This Answer Correct ?    1 Yes 0 No
Ankit Gosain
 
Answer
# 7
we can use aggregator stage.. nad group on the basis of name and company... 
Is This Answer Correct ?    0 Yes 0 No
Abc
 

 
 
 
Other Data Stage Interview Questions
 
  Question Asked @ Answers
 
How many nodes supported by a one cpu in parallel jobs? IBM 3
Source Like department_no, employee_name ---------------------------- 20, R 10, A 10, D 20, P 10, B 10, C 20, Q 20, S and Output should be like this department_no, employee_list -------------------------------- 10, A 10, A,B 10, A,B,C 10, A,B,C,D 20, A,B,C,D,P 20, A,B,C,D,P,Q 20, A,B,C,D,P,Q,R 20, A,B,C,D,P,Q,R,S   3
job locking methods? How can we unlock the job? IBM 2
SOURCE LIKE I_D,F1,F2 --------- 100,N,Y 100,N,N 100,Y,N 101,Y,Y 101,N,Y 102,Y,N 103,N,N 104,Y,Y 105,N,N 106,N,Y 102,N,Y 105,Y,Y O/P LIKE ID flag1 flag2 101 Y Y 101 N Y 102 Y N 102 N Y 104 Y Y 106 N Y   4
i want for the 3rd max sal using for the any stage but max sal is based on the deptno ? any body know this ans pls send this mail siva3me@gmail.com Wipro 2
With out using Funnel Stage, how to populate the data from different sources to single target Wipro 10
in one scenario source flat file like Fileld1 00122001550056200568 00256002360014500896 00123004560078900258 00147004560025800256 divide each 5 numbers as one column i.e here i need field1 field2 field3 field4 00122 00155 00562 00568 00256 00236 00145 00896 00123 00456 00789 00258 00147 00456 00258 00256 plz help me....   3
source file having the data like aabbccc, i want target file result like a1a2b1b2c1c2c3.   2
CAN WE DECLARE DATASET SET WITH OTHER THAN .DS EXTENTION OR NOT IF YES WHAT IS THE DIFFERENCE U FIND?IF NOT WHY?   2
Hi all, can u explain header and trailer records in file? If a file has header and trailer /master-detail records how will you read it in datastage?   1
how can we extract data with out having any common column IBM 7
What is Horizontal transformation, vertical transformation,diagonal transformation? Cap-Gemini 2
 
For more Data Stage Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com