right truncate in transformer

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

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

right truncate in transformer

Post by arnie_nits »

Hi,

I have a column like QDL Marine and Static Diesel Engines (In).
Now I need to make it like QDL Marine and Static Diesel Engines (In).The length of this value differs from record to record.

I tried with convert but then it become QDL Marie ad Static Diesel Egies.

Please suggest.

Thanks,
Arnie
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:? There's no difference between your 'before' and 'after' examples that I can see. It looks like you tried to remove all of the 'n' characters but I can't see why. Yet.

Help us out here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you trying to remove the last word from the field? Is what you need actually "QDL Marine and Static Diesel Engines" in this example?
-craig

"You can never have too many knives" -- Logan Nine Fingers
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

Post by arnie_nits »

Yes sir
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The trims may not be strictly needed but make this more fool-proof:

Code: Select all

Field(Trim(YourField)," ",1,DCount(Trim(YourField)," ")-1)
Pop quiz: what exactly is this doing? :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, Arnie... not going to take the pop quiz? :(

I generally don't like to give pure code solutions for things like this as I'm afraid there's no learning going on, one can simply plug it in and move on without have to actually understand how it works. I feel like I'm handing out fish rather than a fishing pole. Oh, well, hope you take the time to break it down and understand the bits so you can leverage the techniques elsewhere should the need arise.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply