Filter the string data

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
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Filter the string data

Post by arshi »

Hi,

I have a requirement to filter the 5 character data from the source file and load the data into Target.Source data will provide in text file with pipe delimeter.How to impliment this logic and is there any function available in datastage.

Datastage: Server edition(7.X)
Source: Text File(Pipe delimetr)

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

Post by ray.wurlod »

Sequential File stage with pipe character ("|") specified as the field separator.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Post by arshi »

Ray,

Once importing data into sequential file,how to build the mentioned filter logic(to filter the 5 character data from the source file ) .Can you give the solution for this.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What do you mean by "filter"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Post by arshi »

Hi,

One of my source column data having the word 'Index' (this word is part of the Text).If the 'Index' word occured then I want to remove that particular row while populating to the Target.

I am trying with 'Matches' function.But unable to get the solution.

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

Post by ray.wurlod »

Funnily enough you need the Index() function.

Code: Select all

Index(InLink.TheString, "Index", 1) = 0
can be your constraint expression.

You *could* use Matches but need to specify the wildcard characters correctly.

Code: Select all

Not(InLink.TheString Matches "...'Index'...")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arshi
Participant
Posts: 50
Joined: Wed Apr 18, 2007 5:12 am

Post by arshi »

Its working fine by using Index() function

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

Post by ray.wurlod »

Please mark this thread as Resolved using the green button at top.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply