were clause in filter

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
Mritunjay
Participant
Posts: 1
Joined: Thu Oct 13, 2005 10:39 pm

were clause in filter

Post by Mritunjay »

I am having a string eg. MAN,LANGUAGE I have to pick only that string which is before comma eg. MAN by using filter where clause.

If any one is having suggestions pls reply.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Not really a filter but a string transformation, have a look at the FIELD command in the transform function list or one of the string commands in the Modify stage.
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Post by RAJEEV KATTA »

Hey vmcburney,
You can try the following thing in transformer stage
field(inputcolumn,",",1).This would give you the string before , i.e MAN as per your example MAN,LANGUAGE.

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

Post by ray.wurlod »

... but a Modify stage is lower impact and therefore likely to be more efficient than a Transformer 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.
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Post by RAJEEV KATTA »

Hi Ray,
I have used string function field in modify but that didnot resolve the problem,can you be more specific like what type of string functions shall i use in modify which would be more effective than transformer stage.

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

Post by ray.wurlod »

Not unless you show exactly how you used the FIELD function. I can't read your mind and am not prepared to waste time guessing what you might have done.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

I don't think this can be done with the Modify stage. The Modify stage is aimed towards type conversions and has very little in the way of string manipulation. The only string to string conversion functions I know are substring and string_trim.
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Post by RAJEEV KATTA »

Hi Ray,
This is how i did it i have taken an input column by named name which contains data in the format MAN,LANGUAGE.Now i have used the modify stage with the following string function in this manner ouputname:string=field(name,",",1) where outputname is the name of the output column.But this is giving an error,so could please how tell me how i could resolve the problem.

Cheers,
Rajeev.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

The Modify stage uses a different set of functions to the Transformer stage. FIELD is available in a transformer but it is not available in a Modify stage. As I said in my previous post there are very few string manipulation functions in a Modify stage unless you are converting to or from string type. Stick with a Transformer.
RAJEEV KATTA
Participant
Posts: 103
Joined: Wed Jul 06, 2005 12:29 am

Post by RAJEEV KATTA »

Hey vmcburney,
Thanks vmcburney i was just looking at the statement said above that modify is more efficient and trying to look if there is any such string function which serves the purpose thats it.

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

Post by ray.wurlod »

Nowhere did I claim that the Field() function is available in the Modify stage; I simply asserted that the Modify stage is more efficient (because it generates an osh operator directly, without the need to generate a called function as the Transformer stage does).

String manipulation (other than data type conversion) is very limited in the Modify stage, as you will see in the table beginning on page 28-7 of the Parallel Job Developer's Guide or Chapter 13 of the Orchestrate 7.0 Operators Reference

I'm sorry about any confusion that this may have caused. I don't believe there is any way in the Modify stage to extract a delimited field from a string (or from a ustring).
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