Substring and trim funcations in modify

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
SwathiCh
Premium Member
Premium Member
Posts: 64
Joined: Mon Feb 08, 2010 7:17 pm

Substring and trim funcations in modify

Post by SwathiCh »

Hi All,

I need to trim the input column first and then need to extract first 15 bytes of that column, I can do this in transformaer with simple derivation but i need to implement this in MODIFY stage.

I am giving the specification as below
COL2_ID=substring[1,15]((string_trim[" "](COL1_ID)))
It is throwing the error as

Error parsing modify adapter: Error in binding: Expected source field selector; got: "("
Expected destination field selector, got: ")"; input:


If I remove string_trim funcation and run the job (with substring only), it is running fine but I need to trim the column as well.

Even I tried as below
COL2_ID=substring[1,15](string_trim[" "](COL1-ID))
this also throwing error.

Can any one help please?
--
Swathi Ch
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

As a general rule the modify operator does not support nested functions.

You can use two modify operators, but need a copy operator between them (either explicitly or implicitly).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
SwathiCh
Premium Member
Premium Member
Posts: 64
Joined: Mon Feb 08, 2010 7:17 pm

Post by SwathiCh »

Thanks Ray,

One more doubt, If i use two modify stages and one copy stage, it will create 3 processes on server. If i use transformer , it will create only one process on server though it takes much compilation time(I dont care compilation time).

So here in this case, is it better to use transformer than modify?
--
Swathi Ch
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Operator combination will mean that the three stages will execute in the same single process.
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