alphabets and digits extraction from a string.

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
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

alphabets and digits extraction from a string.

Post by kollurianu »

I have following strings

OOAY08-01-2007
MCHTBB01-07-08

I need to seperate into two different strings ,

like OOAY and 08-01-2007
How can i acheive this in parallel job.?
I know in server we can acheive this by using OCONV function for extracting Numeric and Character part..

In parallel job how can it be done...if we need to write a routine..
should it be in C++.Can some give ideas...


Thank you all in advance.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

'Convert' to Numbers to empty strings. And that goes to Sting part.
Find length of this Sting and get the substring from the main string as staring from the string lenght to the total length.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Also if you know that the last field value is a date of length 10 then take a substring to get the second field value
rsomiset
Premium Member
Premium Member
Posts: 46
Joined: Fri Sep 21, 2007 7:16 pm

Post by rsomiset »

devidotcom wrote:Also if you know that the last field value is a date of length 10 then take a substring to get the second field value
Hi,
But in the sample data given, the second record has only 8 digits in the date part. So, we cannot get the substring of second field value with this variable length of date.
--
Raj
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Yes you are right Rajesh. I was thinking in similar lines as Kumar suggested.

Thank you all for your responses.
Post Reply