trim in DS?

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
sweetleaf
Participant
Posts: 30
Joined: Fri Jan 24, 2003 3:28 pm
Location: Canada

trim in DS?

Post by sweetleaf »

Hi there,

Is there an equivalent to vb or oracle TRIM function in DataStage?

I have a seqential file stage connected to one transform, then 2 output links from the transform stage.

In the transform stage I'd like to trim the leading and trailing spaces in the contents of a field before sending the field out through the output links.

I don't have the DS documentation on me so can't look up how to achieve this. I'm assuming the function -if there is one- would be placed in the derivation section for the column in question inside of the tranform stage?

Thanks!
eoyylo
Participant
Posts: 57
Joined: Mon Jun 30, 2003 6:56 am

Post by eoyylo »

You can use the function "Trim" in the rigth side of trasformer.

Mario

quote:Originally posted by sweetleaf
[br]Hi there,

Is there an equivalent to vb or oracle TRIM function in DataStage?

I have a seqential file stage connected to one transform, then 2 output links from the transform stage.

In the transform stage I'd like to trim the leading and trailing spaces in the contents of a field before sending the field out through the output links.

I don't have the DS documentation on me so can't look up how to achieve this. I'm assuming the function -if there is one- would be placed in the derivation section for the column in question inside of the tranform stage?

Thanks!
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

sweetleaf

There is help within the Designer.

trimb() - removes trailing spaces
trimf() - removes leading spaces
trim() - removes trailing, leading and redundant spaces
trim(string, char, option) - where char is any single character
option:
A Remove all occurrences of character
B Remove both leading and trailing occurrences of
character
D Remove leading, trailing, and redundant white
space characters
E Remove trailing white space characters
F Remove leading white space characters
L Remove all leading occurrences of character
R Remove leading, trailing, and redundant
occurrences of character
T Remove all trailing occurrences of character

Thanks Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
Post Reply