Repetition element in xml input and output stage

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
parvathi
Participant
Posts: 103
Joined: Wed Jul 05, 2006 4:48 am
Contact:

Repetition element in xml input and output stage

Post by parvathi »

Hi..

I have developed a job with two sequential stage and exported the job as xml file.. Ihave used the this xml file as an input in the xml input stage... Here in this we have to specify a repition element on which the output xml wil be generated....

here i have a doubt on what basis you select the repetition element or the key element...

I have tested with all the meta data columns genetrated from the xml meta data importer tool ... i was able to get the data but it is not in the exact format in which the input xml file was generated...


can anybody help me in selecting the repetition element....??
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post by Kirtikumar »

Repitition element is column something like a primary key in table. While generating the XML, XML records are generated according the value in this col.

So if you have to generate XML for employee table, empno will be your Repitition element. Now the generated XML will have those many records as per the input Empl table.

If your repitition element is other than Empno then your output XML may not be proper and may have multiple root tags or two empl records can be considered as single record.
Regards,
S. Kirtikumar.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You do NOT process exported metadata as if it were data. It's just bad practice - and the style sheets do not provide any information about relationships and dependencies; your next question is doubtless being unable to import DataStage components from the modified XML. You're on your own here!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
manu.dwhds
Participant
Posts: 30
Joined: Fri Sep 26, 2008 9:33 pm
Location: Bangalore

Re: Repetition element in xml input and output stage

Post by manu.dwhds »

parvathi wrote:Hi..

I have developed a job with two sequential stage and exported the job as xml file.. Ihave used the this xml file as an input in the xml input stage... Here in this we have to specify a repition element on which the output xml wil be generated....

here i have a doubt on what basis you select the repetition element or the key element...

I have tested with all the meta data columns genetrated from the xml meta data importer tool ... i was able to get the data but it is not in the exact format in which the input xml file was generated...


Hi ,

Now i got your question if you want to find repetition element we have few ways to find:

1) in xml file find which one is lowest grain means key column for that Unique element.
2) if any repetition segemts is there you need to care and extarct separatly using in that segemnt lowest grain key column.
3)find xsd there we can find which segment Max Occures and Min occures so that we need to extract separatly taking as a differnt key columns.

can anybody help me in selecting the repetition element....??
Manu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That is not how you quote someone. Did you Preview this before you submitted it? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Indeed...it's not entirely clear what your question is.

However, if the question is about how to find the repetition element, here are some guidelines:

a) first determine what information you need/want from the xml docs.
b) determine if the information you want is on the same "path". This is usually the hardest part. You need to look at resources like an xsd, and also some actuall document instances. If two nodes repeat at the same level, then they have to be dealt with separately (each via the own output link). A primitive example of that might be an employee file. For each higher level person node, there might be a node for "job titles," with a repeating element for every position the person has ever held in the company, and another node for "dependents"....with a repeating element for their partners and children. Two links, minimum, would be needed ,each with their own "repeating element".
c) decide upon the "lowest level" in the hierarchy that you care about for retrieval. In the example above, perhaps job criteria, with job name, description, salary at that job, etc. are important.
d) for XMLInput (reading) choose any element in that lowest level as your repetition element.
e) for writing it's a bit more complex, and you will benefit by choosing an element whose values are unique.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply