Substring function in 7.5

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
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Substring function in 7.5

Post by ds_is_fun »

What should I use for the Substring function which doesnt seem to exist in 7.5 . Thanks!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I would be very surprised if what you claim is true. Substring is one of the most fundamental functions in ETL data processing.

What evidence do you have for your assertion?

Unfortunately I can not check, as I am currently working on a 7.1 site.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Eric
Participant
Posts: 254
Joined: Mon Sep 29, 2003 4:35 am

Post by Eric »

I think SubStrings is a Server Function and not a Parallel function.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
Sub-Strings in DS are achieved by [startpos,length] i.e: link.col[1,4]
it is the same in a server transformer and in a parallel transformer.
(and yes I've just checked it on 7.5 - just for fun ;) )

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
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

You can also do a left(), right(), and nested version of both, blah blah blah...

If you're looking for substr(), you will fail in your search. Broaden your mind and your document-reading prowness. (See parjdev.pdf, "Functions" chapter, scroll down to "String" section. Unfortunately, no mentions are made of [,])
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

There is no specific substring function for a transformer (other then square brackets) however there is one for the modify stage:

specification
out_field1 = substring[4, 6]in_field1

If you were only using your transformer from null handling, trims and substrings then the modify stage should be a lot faster.

The guide doesn't come out and tell you that string[n, n] is the way to do substrings in transformer stages, and it doesn't explain why the functions in the transformer stage are different to those in the modify stage and it doesn't have a full list of available functions.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

So the real question is where do we get the proper docs? :(
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
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

Ask Ascential Support for a copy of the Orchestrate documents.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

vmcburney wrote:If you were only using your transformer from null handling, trims and substrings then the modify stage should be a lot faster.
That is incorrect. All versions from 7.0.1 and above have vastly improved Transformer's runtime performance to a point where it is much faster than Modify, Filter, and other equivalent stages. It is now a matter of performance between compiled code and intepreted code.

Of course, the comple time is slower, especially if your compiler only have a 1 user license (only 1 transformer compile at a time...) Performance for development is so much better if you have 2-5 user license for your compiler alone.
s1kaasam
Participant
Posts: 17
Joined: Wed Feb 02, 2005 5:11 pm
Location: virginia

Post by s1kaasam »

Hi
Yes the substring function exists in 7.5 but the only difference is is syntax.As said earlier in one of the replies to the question the syntax is

ColName[starting character,No. of positions]

This would take care of substringing in the transformer stage for sure.
shravan
Post Reply