Filter a records

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

Filter a records

Post by arnie_nits »

Hi,

Can we filter a record where the length of a particular field id >5.

I have used Len(EMP_ID)>5 in the where condition but I am getting error.

Regards
Arnie
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not permissible in a Filter stage. SQL functions are not supported. You need to use a Transformer stage either to do the filtering or to generate an actual length number that you can use in a downstream Filter stage. Or use string_length() or ustring_length() - as appropriate - in an upstream Modify stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Re: Filter a records

Post by Minhajuddin »

arnie_nits wrote:Hi,
Can we filter a record where the length of a particular field id >5.
Yes. You can do this in a transformer by putting the appropriate constraint.
arnie_nits wrote: I have used Len(EMP_ID)>5 in the where condition but I am getting error.
Len(EMP_ID) in the where condition?

Len() is a datastage function and not an SQL function, so, if you are trying to run a query with this it won't work. The function to find length in SQL is Length().

If you are not using it in SQL then where are you using this function and what error are you getting?
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

"WHERE condition" is a property of a Filter stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Post by Minhajuddin »

Oh, so lousy of me :oops:
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
Post Reply