DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
This topic has been marked "Resolved."
Author Message
sarathcr



Group memberships:
Premium Members

Joined: 29 May 2008
Posts: 3

Points: 28

Post Posted: Tue May 29, 2012 6:07 pm Reply with quote    Back to top    

DataStage® Release: 8x
Job Type: Parallel
OS: Windows
Hi,

I am trying to use the filter stage to output the data. The structure of the job is SeqFile -----> Filter ----> SeqFile

My source data looks like as described below.

EmpNo EmpName DeptNo
1 ABC 10
2 BCD 20
1 ABC 10

In the filter stage I set the where clause as DeptNo=10 and selected the Option=Output rows only once . In my outputfile I am getting two records. As per the option that I set I am expecting only one record. Please let me know where I am doing wrong.

Thanks in Advance,

C
jneasy
Participant



Joined: 29 Jan 2012
Posts: 9
Location: Australia
Points: 60

Post Posted: Tue May 29, 2012 7:07 pm Reply with quote    Back to top    

Hi sarathcr,

I'm still relatively new to DS but it looks like that the option "Output Row Only Once" set to true will output the row only to the first where clause it matches and wont remove duplicates.

I would suggest using the "Remove Duplicates" stage and use DeptNo as the key.

_________________
Joseph Neasy
rxp Services
Rate this response:  
Not yet rated
jwiles



Group memberships:
Premium Members

Joined: 14 Nov 2004
Posts: 1236

Points: 9942

Post Posted: Tue May 29, 2012 10:27 pm Reply with quote    Back to top    

That is correct. The "Output Rows Only Once" option refers only to individual rows...when selected a row will be output only once, no matter how many clauses it matches. The Filter stage has no ability to identify and remove duplicate rows, which is what you are apparently looking for. A combination of Sort and Remove Duplicates, or the Sort stage alone can accomplish this for you.

Regards,

_________________
- james wiles


All generalizations are false, including this one - Mark Twain.

Last edited by jwiles on Fri Jun 01, 2012 8:54 am; edited 1 time in total
Rate this response:  
sarathcr



Group memberships:
Premium Members

Joined: 29 May 2008
Posts: 3

Points: 28

Post Posted: Fri Jun 01, 2012 12:55 am Reply with quote    Back to top    

Thank You Jwiles. It solves my issue. Just I want to add little bit explanation to it.

If the Filter stage contains two where clauses 1) Dept=10 2) EmpName=ABC and the option= OutputRow only once. Then the output of 1st where clause (Dept=10) get two rows, but the 2nd where clause (EmpName-ABC) get no rows.

_________________
With Regards
Sarath
Rate this response:  
Not yet rated
jwiles



Group memberships:
Premium Members

Joined: 14 Nov 2004
Posts: 1236

Points: 9942

Post Posted: Fri Jun 01, 2012 8:54 am Reply with quote    Back to top    

Yes...that was completely understood from your original explanation. There were two rows where Dept = 10, thus you had two rows output by that filter clause. Filter operates at the individual row-level ONLY---one row at a time.

Regards,

_________________
- james wiles


All generalizations are false, including this one - Mark Twain.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours