Seperating the 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
thatiprashant
Participant
Posts: 25
Joined: Mon Sep 19, 2005 11:32 am

Seperating the string

Post by thatiprashant »

Hi Guys.

I am working on mainframes and looking to split the colum info into two parts as i get the data like #kkkkkkkk# 19,trdgar place, USA
i need to seperate the field with address in one column and the other part in # # be in another columns... and they are not fixed width.

Any help is much appreciated.

Thanks
Prashant
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

try Field(%string%,%delimiter%,%occurrence%,[%number%]) function
thatiprashant
Participant
Posts: 25
Joined: Mon Sep 19, 2005 11:32 am

Post by thatiprashant »

keshav0307 wrote:try Field(%string%,%delimiter%,%occurrence%,[%number%]) function
thanks keshav for ur reply...

actually it is not the number it always starts with after # # this data.

thanks
thatiprashant
Participant
Posts: 25
Joined: Mon Sep 19, 2005 11:32 am

Post by thatiprashant »

keshav0307 wrote:try Field(%string%,%delimiter%,%occurrence%,[%number%]) function
thanks keshav for ur reply...

actually it is not the number it always starts with after # # this data.

thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You are going to need to assemble the fields into a single field, so that a string such as the one in your original post occurs. Then apply the Field() function to that, returning everything after the second "#" character.

Code: Select all

Field(assembled_data, "#", 3, Count(assembled_data, "#") - 1)
If you get unusual "job parameter" errors, change "#" to some other character when creating the assembled_data string.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply