Page 1 of 2

Datastage 8.0 XML Input Stage Usage - Need Clarification

Posted: Mon May 26, 2008 11:05 pm
by santanu84
Hi

We are trying to create one parallel job where we will read one XML file as input into a XML input stage for further processing.
In Datastage 8.0 version we do not have any Folder Stage option.
So the trick which we have used is,we first used one sequential file stage where we read that entire XML file "test.xml" as a stream input into one single column "XML Record" of that sequential file with Record Type as implicit and Field Delimiter as none in Format page.
Then we have fed this column into XML Input Stage.

But the problem which we are facing is if the "test.xml" file size is huge (say more than 500 bytes) the input xml data is getting truncated into two rows in the sequential file and hence we are not able to feed those data into XML Input Stage.

Can any body explain how to use the sequential file stage to read xml file as input into XML Input Stage?

Is there any limitation while using this trick for XML Input Stage?

Posted: Mon May 26, 2008 11:28 pm
by chulett
Instead use an External Source stage to pass the full XML filename to the XML Input stage and switch it to use the 'Filename/URL' option.

Posted: Tue May 27, 2008 12:51 am
by santanu84
Hi

I have tried to use External Source stage. There in Properties tab I used Source Method as Program Files and Source XML File as "test.xml" with path.
Then in Format tab Record Type implicit and inside Field Defaults Delimiter as none.
But in Column tab what column shall I use,
Columns same as the XML file or any single column to read data as stream input from the XML?
I tried but when I am trying to View Data of XML it is unable to show me that.

Can you plz specify how to configure the External Source stage in this scenario?

Posted: Tue May 27, 2008 2:38 am
by santanu84
The External Source Stage has not worked......
does any body know any other solution around? :?:

Posted: Tue May 27, 2008 5:52 am
by throbinson
The External Source stage WILL work. Go to Ernie's blog and search for it.
http://dsrealtime.wordpress.com/category/xml/

Posted: Tue May 27, 2008 10:42 am
by lstsaur
For Windows platform, it has problems. What's the error message when you using External Source stage?

Posted: Tue May 27, 2008 7:07 pm
by eostic
The syntax for list ("ls") will be the same, since EE has a unix command layer under the surface, and C: is left out of the fully qualified string in my job [what to do for D: is an interesting question --- anyone know?]. This is what I use in my windows version of a job that does this:

ls #xmlsubDirectory#*.xml | sort

Where the job parameter is set to

/dir1/dir2/dir3/myXMLdocuments/

Ernie

...btw...folder is in v8....but it's not an EE Stage, just a Server side stage.

Posted: Wed May 28, 2008 5:44 am
by santanu84
Hi

I have tried with External Source stage.
There it is able to read the input xml file and feeding it to the XML Input stage.

Then in the XML Input stage in Input tab I have selected XML source column as the column from External Source stage and Column Content as URL/File Path.

But the point is how shall I map this to the Output of the XML Input stage to get the data?

Thanks in advance.

Posted: Wed May 28, 2008 5:58 am
by chulett
The same way you should have been doing it all along - via the proper XPath Expressions in the Description fields of the output link. Import the metadata from an xsd and they will be created for you automatically.

Posted: Wed May 28, 2008 6:00 am
by sjordery
santanu84 wrote:But the point is how shall I map this to the Output of the XML Input stage to get the data?
Same way as you would with the Input XML stage using the Folder in Server - map using xpaths declared in the description field of the table definition.

All detailed in the XMLPACK guide in the DataStage docs.

Regards,
S

Edit: ps. I'm too slow!

Posted: Wed May 28, 2008 6:41 am
by santanu84
Hi Friends

Thanks for Help.

It has been done successfully.

Thanks again for this enormous help.


Regards,

:D

Posted: Wed May 28, 2008 6:43 am
by ray.wurlod
You might like to mark this thread as Resolved, then.

Posted: Tue Jun 01, 2010 2:06 pm
by jpnrd
santanu84

Can You Please Post how you got that problem resolved. I am also stuck with the same problem. Please Help Me....

Thanks
Jaya

Posted: Tue Jun 01, 2010 2:07 pm
by jpnrd
santanu84

Can You Please Post how you got that problem resolved. I am also stuck with the same problem. Please Help Me....

Thanks
Jaya

Posted: Tue Jun 01, 2010 2:19 pm
by eostic
It's all in the thread. Start a new thread and outline what issues you are having.