Right justify using string_trim in Modify stage

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
crsimms
Charter Member
Charter Member
Posts: 21
Joined: Mon May 30, 2005 4:21 am
Contact:

Right justify using string_trim in Modify stage

Post by crsimms »

Hello all,

I have a situation where I want to within a Modify stage:

a. Suppress a leading edge character.
b. Right-justify the resulting string

Column meta-data is as follows:

input - ColY Varchar (64)
output - ColX Char (15)

Test input value - "ggggggreen"

Specification = ColX:string[15] = string_trim['g',begin,end](ColY)
Output - "......reen....." (A dot is used to represent an actual space)

Specification = ColX:string[15] = string_trim["g",begin,end](ColY)
Output - " ......reen....." (A dot is used to represent an actual space)


Test input value - "ggggggreenxxxxxxxxxxxxxxx"

Specification = ColX:string[15] = string_trim['g',begin,end](ColY)
Output - "....reenxxxxx" (A dot is used to represent an actual space)

The output suppresses the leading edge 'g's but does not right-justify. I have looked within the Orhestrate 7.0 Operators Reference and have not found any help as this function is undocumented.

Any help would be appreciated,
Chris Simms

Mobile: +972 989 0919
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
How about using the

Code: Select all

string trim_leading_trailing
(string)
:?:

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply