XML question

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
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

XML question

Post by tonystark622 »

I need to generate an XML file, where
- each line is a properly formatted XML document
- each line is terminated by the appropriate new line char

I spoke with an Ascential rep and was told that this requirement wasn't normal. He suggested using an XML chunk and perhaps having a "pass through" field that had the appropriate new line char in it. I tried this, but apparently wasn't successful.

Anyone have any ideas?

Thanks,
Tony Stark
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If the XML document in each line isn't too long, perhaps a DIY approach where you have a Sequential File stage writing a single column that contains the document, the document having been produced by an expression in a preceding Transformer stage?
(An obviously quick response without a lot of thought about alternatives - I'm in an airport lounge right now (no surprise!).)

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Can you output each XML document individually through a DataStage job into a directory then concatenate them into a single file. A Unix/Windows script would append each XML document to a master file with a return character. It is called as an after job routine so the master XML file gets appended to as each XML document is created.

Vincent McBurney
Data Integration Services
www.intramatix.com
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

Ray and Vincent, thanks for your replies.

(me putting on my stupid hat)[:D]

I figured it out.

Problem 1 was that I didn't understand that I would essentially have one field coming out of the XML Output stage containing all the XML for one row.

Problem 2 was that I needed an output link from the XML Output stage to a sequential file stage, not writing to a file directly from the XML Output stage.

Problem 3 was that the XML Output stage needed the Output Mode on the Transformation Settings tab (on the Output tab) set to Single Row, not Aggregate all rows (the default).

Once I figured out these three things, it was a piece of cake.

Thanks again for your time and your replies.

Tony
Post Reply