XML Stage Convert from Old v6.1 to new V8.1

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post 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>
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post 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>
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

I tried with NO XML but still no luck.
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post 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
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post 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
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

let me try this
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post 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
jesjes1981
Participant
Posts: 1
Joined: Thu Sep 15, 2011 6:20 am
Location: hyderabad

Hi,

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The document is hosted at Kim Duke's website.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Thanks For all your help.

I will try now.
Post Reply