trimming columns when RCP is enabled

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
Pratibha_Upadhye
Participant
Posts: 1
Joined: Wed Nov 10, 2010 12:16 am

trimming columns when RCP is enabled

Post by Pratibha_Upadhye »

Hi,
I am using the schema files to read the metadata using a sequential file stage and using RCP to propagate the columns furthur.

I have a condition where I have to trim the leading and trailing blank spaces of the delimted columns
before I load the data in the database.


Example:
Source data :
a~ b ~c ~ d e ~f

Target data :
a~b~c~d e~f

Please help
samyamkrishna
Premium Member
Premium Member
Posts: 258
Joined: Tue Jul 04, 2006 10:35 pm
Location: Toronto

Re: trimming columns when RCP is enabled

Post by samyamkrishna »

You should be able to do it by using the Trim(Columnname) function.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

As soon as you need to perform some operation on a column that column must be named on the input link - it can not "magically" be produced there by RCP. That is, your Trim() function has to have an argument.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

You can use the trim(columnname) function and if that column name is present in the input then it gets applied.

Regards
Sreeni
meet_deb85
Premium Member
Premium Member
Posts: 132
Joined: Tue Sep 04, 2007 11:38 am
Location: NOIDA

Post by meet_deb85 »

Hi Ray,

But there has to be some way by which i can take this entire row in one string through a column export stage, and the try to remove all the whitespaces after the the delimiter "~".

I guess in this case the whitespace between the characters need to be kept within the string.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Only if the column is named. You can't do it with RCP.
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