parsing comma separated values coming from xml

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
roshanearly
Participant
Posts: 27
Joined: Thu Aug 09, 2012 4:55 am
Location: bangalore

parsing comma separated values coming from xml

Post by roshanearly »

hii all

My input is like - Abc,Bcd,Cde,Fgh

i have to parse this and perform lookups separately for each of these (number of comma separated values is not fixed)

Also i need to insert lookup id's and some other data individually into my db


so in db entries will be like

11(Lookup id of Abc) 20 30 40
82(Lookup id of Bcd) 20 30 40
43(Lookup id of Cde) 20 30 40
94(Lookup id of Fgh) 20 30 40
ROSHAN
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure that where it is coming from matters, however not being a fixed number can unless you are aware of the maximum number it could be. Then you can perform a horizontal Pivot and filter out the 'empty' occurrences afterwards.

There are some alternatives but first curious if you are actually using a Server job as the post is marked?
-craig

"You can never have too many knives" -- Logan Nine Fingers
roshanearly
Participant
Posts: 27
Joined: Thu Aug 09, 2012 4:55 am
Location: bangalore

Post by roshanearly »

hii chulett

the maximum number is fixed ie- 30 .yes i am using a server job .kindly throw some more light on it
ROSHAN
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No more light required. Do the pivot as Craig suggested (using the Pivot stage), then you can do your individual lookups. Handle the failed lookups however you wish in the Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Other options, like Transformer Looping, are not available in a Server job. That's why I wanted to double-check.
-craig

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