Handling XML document as INPUT FILE

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
murur
Participant
Posts: 19
Joined: Wed Apr 14, 2004 7:55 am

Handling XML document as INPUT FILE

Post by murur »

I am trying to develop a POC which take input datafiles in XML format.

1) I have a sample XML file and able to import the meta data. no issue

2) I want to read the XML file as input data file and write to a sequential file. Could you pl. tell me how to do that. What "stage" I have to use to implement this?

I have tried with XML Input Stage under (RealTime) group. There is no place I can mention the Path and file name about input files.

Thank you,
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

murur,

I suspect that the folder or sequential file stage is what you need to specify the filename/path. You can view the documentation for the XML stages in your c:\Program Files\Ascential\DataStage\Docs directory. The filename is 'XMLPACK_20_Designer.pdf'.

Good luck!

Tony
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

From what I understand, you should use the Folder stage in conjunction with (to feed) the XML Input stage. Works well as long as the XML files are not "too big".
-craig

"You can never have too many knives" -- Logan Nine Fingers
larryoceanview
Participant
Posts: 70
Joined: Fri Dec 26, 2003 3:14 pm
Location: Plantation, FL

Post by larryoceanview »

I was having the same problems last week,

check this post:

viewtopic.php?t=88040

Larry
rkumar28
Participant
Posts: 43
Joined: Tue Mar 30, 2004 9:39 am

Post by rkumar28 »

Hi Muroor....

There are couple of ways to read XML file. You can use sequential file stage, Folder Stage or XML Transformer Stage.
I am using the Folder Stage to read the XML file. In the folder stage under the columns....there will be two columns one with the name of the source XML file and the other is the record. It is the record column that will actually be containing all the XML data to be parsed in the XML Input stage.
Also, in folder stage in the Properties Tab under OutPut Tab make the wild card soemthing like *YOURXMLFILENAME*.

In XML Input stage...in XMLSOURCE under Input column.....choose the record column and check XML document button.

Also, If your Source XML file is big and the data is bigger than the record column can handle in folder stage....I will suggest using the Folder stage to pass the URL path to the XML file...In this case you will not be having the 'record' column at all in folder stage. XMLInput stage you will need to check the 'URL/FilePath' button....

I hope this helps....

Thanks.....
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

I was processing a very large XML file and found the folder stage wouldn't work regardless of whether you passed the record or the URL filename. The XML Input stage still tries to load up the entire XML document and aborts when it hits the 2M limit. I ended up processing it through the sequential file stage.
Post Reply