i/p o/p1 o/p2
1 1 4
1 1 5
1 1 6
2 2
2 2
2 2
3
3
4
5
6
how to populates i/p rows into o/p1&o/p2 using datastage
stages?and also the same scenario using sql?
Answer Posted / radhakant kumar
1)by sql say the column name is Id then
a)(for duplicate)
select a.id
from table_name a
left outer join(select id,count(*)as no1
from table_name
group by id
)b
on b.id=a.id
where b.no1>1
order by a.id
it will display 1 1 1 2 2 3 3
b)change the condition where b.no1=1 then it will display
the remainings without duplicates..
2) By DataStage
Step By Step....
a)after source file take Copy stage and draw two
output links
b)one will go to Aggregate stage and take count of
rows by group by Field(id)
it will display like.
ID Count(no)
1 3
2 3
3 2
4 1
5 1
6 1
c)and then use lookup stage main stream will be second link
of copy and reference will be output of Aggregate stage
d)look up key will be ID and fetch count(no) to target
it will display
ID Count(no)
1 3
1 3
1 3
2 3
2 3
2 3
3 2
3 2
4 1
5 1
e)and after lookup stage take transformer or filter stage
by taking two output links and put condition
a)for duplicates count(no)>1
b)for non duplicates count(no)=1
Finally u will get your desired output..
6
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
How will you load you daily/monthly jobs datas in to Fact and Dimension table using datastage.
What is difference between join, merge and lookup stage?
what is the custome stage in datastage? how can we impliment that one? plz tell me
On which interface you will be working as a developer?
What is size of a transaction and an array means in a datastage?
How will you move hashed file from one location to another location?
Explain connectivity between datastage with datasources?
What are the areas of application?
What are the repository tables in datastage?
Where the datastage stored his repository?
how to use self join using datastage ? can u tell me using stage how can we implemnet the self join
What are some different alternative commands associated with "dsjob"?
8000 jobs r there i given commit, suddenly job will abort? what happens? 2)diff b/t transformer stage & filter stage? 3)how to load the data in the source?
What are the primary usages of datastage tool?
options available in sequence job to run,validate?