Page 1 of 1

Posted: Mon Jan 21, 2013 4:07 pm
by eostic
I haven't seen this in awhile. Noticed it most often when there are very few columns in the sub-columns of the repeating node.

Try this: Add a dummy column that is 100% unique (use something like @INROWNUM upstream)...put this dummy column just above ProdCode in the link and give it xpath (the Description property) that looks just like ProdCode but with /dummy/text() at the end instead of ProdCode/text().

See if that produces the xml that you need....of course, it will have an extra element called "dummy".......put an output link on your xmlOutput Stage with a single large varchar column and a single '/' in the Description property. Send that to a Transformer or other means for removing the dummy element.

Ernie

Posted: Tue Jan 29, 2013 4:50 am
by pnpmarques
I realized a pattern that is related to the order how input records are processed:
If "identic" elements are processed sequentially, i.e., one right after another, then Datastage "aggregates" them inadequately.
If by chance they are not processed sequentially then xml is created as intended.

About your suggestion, I am not a fan of that solution but I guess Datastage was not born to deal perfectly with xml. Anyway we tried and it worked, introducing a unique dummy element and then removing it is our workaround at the moment.
Our choice to remove dummy elements was to use unix AWK command (SED is slower). For those who might be interested, it should be something like this:
awk '{a=$0;gsub("<DUMMYID>[0-9]*</DUMMYID>","",a);print a}' INPUTFILE.xml > OUTFILE.xml

Thank you.

Posted: Mon Feb 11, 2013 5:07 am
by Jayakannan
Which one is the key column in XML Output stage under Input->Columns tab?

Posted: Tue Feb 19, 2013 11:25 am
by pnpmarques
I have 2 columns defined as Key, a functional column(like ProdCod) and the new dummy column, but I guess dummy should be enough.

Posted: Tue Mar 12, 2013 2:48 am
by Jayakannan
Desc as key column in Input->Columns' tab of XML Output stage should work.