Reading XML Files using seq file stage
Moderators: chulett, rschirm, roy
Reading XML Files using seq file stage
Hi All,
I am not able to read the xml files though seq file stage. My xml file is l
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- - Generated by Ascential Software Corporation, DataStage - XMLOutput stage -
- Wed Jan 16 14:21:40 2008
-->
- <xtd:BO xmlns:xtd="http://GenericSchema" xmlns:esb="http://schemas/SHeader" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <esb:SHeader>
<esb:EnvironmentName>Development</esb:EnvironmentName>
</esb:SHeader>
- <xtd:load>
- <xtd:Data>
- <![CDATA[ 800009885|700930010|S 9885 PLACE ST FOY|STORES|MALL ENCLOSED|000000980|000000000|000007910|000007910|000008890|BDC-0015|ST FOY||CA|CANADA|Can Dollar|000000000|ACTIVE|01/03/09| | | |COMP|02/03/08|000009885|
</xtd:Data>
</xtd:load>
</xtd:BO>
My job design is
SeqFile Stage------> XML input------->SQL Server.
The issue is I see 10 rows from seq file stage to xml input stage . But there is no transfer of rows from xml input to the target.
In seg File stage :
Read Method = File Pattern
coloum = Record as Long varchar
In XM Input stage :
xml source column = Record
column content = xml source content.
Please Advice.
With Regards,
Kumar66
I am not able to read the xml files though seq file stage. My xml file is l
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- - Generated by Ascential Software Corporation, DataStage - XMLOutput stage -
- Wed Jan 16 14:21:40 2008
-->
- <xtd:BO xmlns:xtd="http://GenericSchema" xmlns:esb="http://schemas/SHeader" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <esb:SHeader>
<esb:EnvironmentName>Development</esb:EnvironmentName>
</esb:SHeader>
- <xtd:load>
- <xtd:Data>
- <![CDATA[ 800009885|700930010|S 9885 PLACE ST FOY|STORES|MALL ENCLOSED|000000980|000000000|000007910|000007910|000008890|BDC-0015|ST FOY||CA|CANADA|Can Dollar|000000000|ACTIVE|01/03/09| | | |COMP|02/03/08|000009885|
</xtd:Data>
</xtd:load>
</xtd:BO>
My job design is
SeqFile Stage------> XML input------->SQL Server.
The issue is I see 10 rows from seq file stage to xml input stage . But there is no transfer of rows from xml input to the target.
In seg File stage :
Read Method = File Pattern
coloum = Record as Long varchar
In XM Input stage :
xml source column = Record
column content = xml source content.
Please Advice.
With Regards,
Kumar66
kumar66,
If you can use the ExternalSourceStage instead,it would be easier though sequential stage can handle the wildcard pattern.
Properties in the External source stage goes this way:
Refer to below url posted by Ernie and Search the posts.
http://dsrealtime.wordpress.com/2007/12 ... -a-source/
If you can use the ExternalSourceStage instead,it would be easier though sequential stage can handle the wildcard pattern.
Properties in the External source stage goes this way:
Code: Select all
Source Method: Specific Programs
Source Program: cat /#Path#/#filename.xml#
(RecordLevel) Final Delimiter: none
Record Delimiter: null
column Datatype/length: LongNVarchar(9999)
Code: Select all
XML file stage:Input Source Column: 'file name'
Column Content: XML document
Output tab: Enable repetition element required and tag an appropriate column as key.
http://dsrealtime.wordpress.com/2007/12 ... -a-source/
Thanks and Regards!!
dspxlearn
dspxlearn
Hi dspxlearn,
Thanks for your reply. I have tried what you have suggested . But I am not getting any records from xml input stage.
And I am not even able to view the data in the external source stage.I am getting this follwoing error when clicking view data button.
##E TFPM 000371 15:27:11(005) <APT_CombinedOperatorController,0> <_PEEK_IDENT_>: Error message (261662) exceeds the maximum message size (131056); dropping.
And I get these warnings :
Missing record delimiter "\x00", saw EOF instead
Import warning at record 0.
Please advise.
Thanks ,
With regards,
kumar66
Thanks for your reply. I have tried what you have suggested . But I am not getting any records from xml input stage.
And I am not even able to view the data in the external source stage.I am getting this follwoing error when clicking view data button.
##E TFPM 000371 15:27:11(005) <APT_CombinedOperatorController,0> <_PEEK_IDENT_>: Error message (261662) exceeds the maximum message size (131056); dropping.
And I get these warnings :
Missing record delimiter "\x00", saw EOF instead
Import warning at record 0.
Please advise.
Thanks ,
With regards,
kumar66
Now it may be more obvious why I send the url via External Source when using EE. It's not worth the headache. Let XMLInput read it.
Alternatively, how much data are we talking about? Use Server for this piece of your app and use Folder.
With either solution you'll be up and running 10 minutes from now.
Ernie
Alternatively, how much data are we talking about? Use Server for this piece of your app and use Folder.
With either solution you'll be up and running 10 minutes from now.
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Are you doing something with the content prior to the XMLInput Stage? If not, use the URL method.... is there another reason that you cannot?
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Check out the link above (dsrealtime.wordpress.com ...there's an XML content entry) ...the syntax is there.... let us know if you find it ok and how it works out....
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Inside the External Source stage you can specify a command. The command to use is "ls" (unix list), with some other arguments. This creates a link column containing the results of the command (varchar and a length of 200 works for me). This link goes into your XMLInput Stage....the stage properties ask you for the column and whether the column contains "XML Content" or "URL"... Pick URL. That's it. The XMLInput stage will go and find the XML and read it from disk, so you don't have to. XML documents are sometimes little chunks of character data with no CRLFs, LFs or other special characters.....but sometimes they aren't...being entirely variable in length, and sometimes with a mixed set of CRLF's and other things. From an XML perspective, it's all noise --- CRLFs are meaningless --- but not so with the Sequential Stage. Unless you need specifically to process the xml content on your own before the XMLInput Stage, then stop trying to use the Sequential Stage and just go with External Source. I'll check my blog entry again to make it more clear how to do this.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>