I have a scenario like
Deptno=10---->First record and last record
Deptno=20---->First record and last record
Deptno=30---->First record and last record
I want those first and last records from each department in
a single target. How to do this in DataStage, any one can
assist me.
Thanks in advance.

Answer Posted / subhash

1.
Source--->Sort stage--->copy stage======>(SRC1,SRC2)
From copy stage we have to take two source stages
(SRC1,SRC2)
SRC-->Removeduplicate stage(in this we can get first
record from each dept--> Duplicates To Retain=First)
SRC2--->Remove duplicate stage(in this we can get last
record from each dept--> Duplicates To Retain=Last)
using funnel we can add these results.

2.
source->sortstage->removeduplications->dataset

in sortstage->create key changecolumn=true
this will set '1' for 1st records and '0' next duplicate
records.
after
removeduplicates stage(key columns=Deptno, CreateKeyChange
Columns)->duplicates retain:-last

we can get last(CreateKeyChange is zero and from all the
duplicates in that group, we are retaing last record) and
first(CreateKeyChange is 1) record group(Dept) wise.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain link buffering?

732


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?

1792


Define oconv () and iconv () functions in datastage?

890


How to reverse the string using unix?

2821


How to RD using transformer?

872






Triggers,VIEW,Procedures

807


whom do you report?

1512


Have you used Unstructured data?

841


What is meta stage?

587


DB2 connector> transformer > sequential file Data will be exported into a csv format in a sequential file. This file will be send in a email using a sequence job. Problem here is, how to avoid sending a blank csv file? When I ran the job there are chances that it might return zero records but in the sequence job csv file is going blank. how can I avoid this? thanks

1045


What steps should be taken to improve Datastage jobs?

650


What is datastage engine?

733


Explain ibm infosphere information server and highlight its main features?

617


What a datastage macro?

644


Explain datastage architecture?

825