Substring of unknown length

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
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Substring of unknown length

Post by sam334 »

Hi all, Need a help in Substring of a value.

We have a column ID:- 1111111111AB01, 2222222222ABCD02, 2121212121ADBC01.

So its a 10 digits length of ID then character. I have (11,4) in transformer to get the character such as AB,ABCD,ADBC.

Now issue is, ID length may change, it could be 11 digit or could be 10 digit. So (11,4) wont work. Any other advice how we could achieve this..

Primary goal is to get the character (AB/ABCD/ADBC) out from the string.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sounds like the "double convert" would work for you. One such example is here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sam334
Premium Member
Premium Member
Posts: 145
Joined: Mon Aug 26, 2013 7:42 pm

Post by sam334 »

Perfect. Thanks a lot Craig.
Post Reply