Page 2 of 2

Posted: Tue Sep 13, 2011 4:22 pm
by mandyli
Thanks for your reply.


The main root is <Claims> under claims <claim-audit-information>, <service-order> under

<service-order>
<service-order-data>
<parts>
<job>

</service-order>

but here service-order and service-order-data XML description defined as following way in OLD job.

SERVICEORDER YES char(8) /service-order/-
service-order-data YES char(7) XML service-order/service-order-data/-

I am not sure how i defined in NEW JOB XML Output stage.

//-----------------------------------------------------------------------------

What is meaning of /service_order/- in description?

After I modified my job I am getting following file.
- <claims>
- <tpi-info>
<archive-flag>Yes</archive-flag>
</tpi-info>
- <claim-audit-information>
<TotalNumberOfRecords>1234</TotalNumberOfRecords>
<NumberOfRecordsinFile>123</NumberOfRecordsinFile>
<SliceNumber>1</SliceNumber>
<PackedFlag>YES</PackedFlag>
<GeneratedBy>ETL NPS NPJ DOWNLOAD</GeneratedBy>
</claim-audit-information>
- <service-order>
SO_NOSVC_UN_NO
<service-order-data>SVC_UN_NO</service-order-data>
</service-order>

Here if under <Service-order > I am getting header also. I have made service-order and service-order-data as KEY 'Yes'.

I would like to print following format. The Service-order,service-order-data and parts filed values coming from transformer stage. What is the correct syntax for XML path
- - <service-order>
<service-order-data>12345||201111|test</service-order-data>
<parts>00000|333333</parts>
- - <service-order>

Posted: Tue Sep 13, 2011 5:17 pm
by eostic
I hope you have gone to a whole new tabledef imported as above...you need to have no "xml" data elements...there is too much potential that they will mess things up.

Posted: Tue Sep 13, 2011 6:51 pm
by mandyli
Thanks

What is meaning of /service_order/- in description?

After I modified my job I am getting following file.
- <claims>
- <tpi-info>
<archive-flag>Yes</archive-flag>
</tpi-info>
- <claim-audit-information>
<TotalNumberOfRecords>1234</TotalNumberOfRecords>
<NumberOfRecordsinFile>123</NumberOfRecordsinFile>
<SliceNumber>1</SliceNumber>
<PackedFlag>YES</PackedFlag>
<GeneratedBy>ETL NPS NPJ DOWNLOAD</GeneratedBy>
</claim-audit-information>
- <service-order>
SO_NOSVC_UN_NO
<service-order-data>SVC_UN_NO</service-order-data>
</service-order>


Here if under <Service-order > I am getting header also. I have made service-order and service-order-data as KEY 'Yes'.

I would like to print following format. The Service-order,service-order-data and parts filed values coming from transformer stage.

What is correct syntax for XML path
- - <service-order>
<service-order-data>12345||201111|test</service-order-data>
<parts>00000|333333</parts>
- - <service-order>

Posted: Tue Sep 13, 2011 8:21 pm
by mandyli
I tried with NO XML but still no luck.

Posted: Thu Sep 15, 2011 11:56 am
by mandyli
In V8.1 I have spilt the job1 and Job2

Job1: Witting into Sequential stage and out put looks good
Jobs 2: Read from Sequential stage into XML output stage.

But still I am not getting proper output.

OLD version XML path
---------------------------------
TPIINFO char(5) /tpi-info/archive-flag
SERVICEORDER YES char(8) XML /service-order/-

But New version I have modified
---------------------------------------------------------------------------------
TPIINFO char(5) /claims/tpi-info/archive-flag/text()
SERVICEORDER YES char(8) XML /claims/service-order/text()

when I added SERVICEORDER columne as key I am getting different and also I am getting following error

"Only one top level element is allowed in an XML document. Error processing resource 'file:///C:/Sears_BI_CS/ETL_SUPPORT/ETL...

<claims>


"
Thanks
Man

Posted: Thu Sep 15, 2011 12:18 pm
by mandyli
And also

when I removed SERVICE ORDER I am getting following error

Derivation rule "/claims/tpi-info/archive-flag/text()" is invalid. Message = "The input rule's root element (claims) is not the same as the repetition rule"


Thanks
Man

Posted: Thu Sep 15, 2011 2:04 pm
by eostic
Parts repeats "under" service-order, doesn't it? If so, then THAT's the single column that needs to be "key"...(repetition element -- it doesn't mean that it is a key, per se).

Ernie

Posted: Thu Sep 15, 2011 3:25 pm
by mandyli
let me try this

Posted: Thu Sep 15, 2011 6:39 pm
by eostic
sounds to me like you don't want a "value" in the service-order element? If so, just delete the column from the link.

Ernie

Posted: Fri Sep 16, 2011 6:13 am
by eostic
as noted above, the column with "parts" should be your key, if that's the node that repeats underneath service-order.

Your xpath looks syntactically correct, but only you can know your data. It should work, provided that "parts" is the only sub-node that repeats under service-order.

If any of the other nodes repeat under service-order, then this is a vastly more complex problem to solve.

Ernie

Posted: Fri Sep 16, 2011 11:24 am
by eostic
For right now, forget the old Job...key is meaningless in the old xmlWriter Stage....it has a far different meaning and impact in the xmlOutput Stage....the functionality and behavior of the two stages, especially for "key" is entirely different......

...as noted in the thread, this exercise will require that you learn how the new one works and build the solution appropriately.

If in fact you have multiple nodes beneath service-order that repeat, then you will need a more complex technique that builds those nodes beforehand.

The Best Practices document for xml will be helpful here. Get a copy of it if you don't have it already...you can find it in various threads in this forum.

It describes how you can build one "chunk" of XML that repeats, put it into a hash table and then do a join to pick it up later. In fact, since you have XML Data Elements in your old Job, its possible that such a technique was already being used. In that way the two stages are similar...

Ernie

Posted: Fri Sep 16, 2011 7:32 pm
by mandyli
Thanks for your help.

I am also thinking like this only.

I am not able to find XML best pratice document.

Can you please point me where I will get it ?


thanks
Man

Hi,

Posted: Fri Sep 16, 2011 9:40 pm
by jesjes1981
Try the same job in in 8.1 using server jobs hope u might get it, in parallel if the data is huge it might not work as from the seq file it checks for every 500 bytes one delimiter and also problem with the xpath may comeup

Posted: Fri Sep 16, 2011 10:04 pm
by chulett
The document is hosted at Kim Duke's website.

Posted: Sat Sep 17, 2011 6:17 pm
by mandyli
Thanks For all your help.

I will try now.