Substring Issue

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
irajasekharhexa
Premium Member
Premium Member
Posts: 82
Joined: Fri Jun 03, 2005 5:23 am
Location: Bangalore
Contact:

Substring Issue

Post by irajasekharhexa »

Hi,

In the Transformation derivation
I taken SourceAccountId[9, 14] derivation.

Input data is '123456789ABCDFGHIJKLMNOP'

I am getting the out put as 9ABCDFGH

Is datastage counts the position of the character from 0 to or 1

Even if the datastage counts the position from 0 it should give the output data as
ABCDFG

Then why Iam getting the different ouput?

Can any body tell how exactly it's working?
Rajasekhar
irajasekharhexa
Premium Member
Premium Member
Posts: 82
Joined: Fri Jun 03, 2005 5:23 am
Location: Bangalore
Contact:

Post by irajasekharhexa »

Ok I understood that datastage counts the firstchar from count 1 but it should give only till 14 th character as the derivation is[9,14] but why it is picking till 16th character?
Rajasekhar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The second value is the substring length to pull, not the ending character position - something a quick check of the documentation would have revealed. :wink:
-craig

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