I am using a complex XML structure that has many levels. Within one level (3 levels deep) I am selecting a number of attributes to create an output file that is flat for that segment of the XML.
My job design is simple:
External Data Source -> XML Input -> Sequential File
In the output I am expecting 4 records. When I select the natural key of the segment as Key I get the unique values for the Key attribute, however all other attributes are repeated for the first occurrence of the natural key. When I select another attribute that I expect to be unique across 4 records I get unique value of that attribute but repeating Natural Key for the following 3 records.
What am I doing wrong?
XML Input and Primary Keys
Moderators: chulett, rschirm, roy
Probably nothing.
FYI - that 'key' field option marks the Repetition Element and is nothing like a Primary Key. Typically one would set it to the lowest level element but sometimes to have to play games. If you truly have many 'levels' then you may need to pull the levels out with one XML Input stage and then use another to parse the levels themselves. I'm a little lost on your explanation so for someone like me, examples would be a Good Idea - snippets of your source and examples of what your output looks like in the various scenarios you outlined here.
Of course, Ernie probably grokked all this straight away, we could always wait for him. I'll sure he'll be along in a minute or two.... [whistles a merry ditty]
Oh, study material - be sure to pull down and cozy up with the XML Best Practices document on Kim Duke's website, all kinds of good information there on working XML with DataStage.
FYI - that 'key' field option marks the Repetition Element and is nothing like a Primary Key. Typically one would set it to the lowest level element but sometimes to have to play games. If you truly have many 'levels' then you may need to pull the levels out with one XML Input stage and then use another to parse the levels themselves. I'm a little lost on your explanation so for someone like me, examples would be a Good Idea - snippets of your source and examples of what your output looks like in the various scenarios you outlined here.
Of course, Ernie probably grokked all this straight away, we could always wait for him. I'll sure he'll be along in a minute or two.... [whistles a merry ditty]
Oh, study material - be sure to pull down and cozy up with the XML Best Practices document on Kim Duke's website, all kinds of good information there on working XML with DataStage.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Craig...you are too funny.
Indeed, Craig is right, the "key" is nothing more than an indicator for the repeating level that you want to retrieve. There are no keys --- just instances of elements.
Each "independent" repeating node (or deeply nested set of nodes) must be on its own link.
See lots of references as noted above -- I also have some things at my blog noted below.
Ernie
Indeed, Craig is right, the "key" is nothing more than an indicator for the repeating level that you want to retrieve. There are no keys --- just instances of elements.
Each "independent" repeating node (or deeply nested set of nodes) must be on its own link.
See lots of references as noted above -- I also have some things at my blog noted below.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>

