How to convert a delimited string to rows but i am not sure

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
vijaydev
Participant
Posts: 54
Joined: Sun May 20, 2007 6:31 pm

How to convert a delimited string to rows but i am not sure

Post by vijaydev »

Hi,


I have a requirement i need to convert one delimited string to rows, but i am not sure how many delimiters i will get it.

Eg:
Input:

Project ID User ID

1 31716#@#31965
2 31924#@#32677#@#31689#@#37011#@#30855#@#30096
3 3251058
4 32401#@#42862#@#32401#@#42862

Expected output is :

Project ID User ID
1 31716
1 31965
2 31924
2 32677
2 31689
2 37011
2 30855
2 30096
3 3251058
4 32401
4 42862
4 32401
4 42862


If use field function than i need to specify the number of delimiter, here i am not sure how many i can get it. Please help me to reslove this.

Thanks In Advance.

-Vijay
vijaydev
Participant
Posts: 54
Joined: Sun May 20, 2007 6:31 pm

Post by vijaydev »

Hi,

Any one pls. help me..


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

Post by ray.wurlod »

Help yourself. Search - parse and pivot.
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