Datastage 8.0 XML Input Stage Usage - Need Clarification

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

santanu84
Participant
Posts: 14
Joined: Mon May 26, 2008 7:17 am
Location: Kolkata

Datastage 8.0 XML Input Stage Usage - Need Clarification

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

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
santanu84
Participant
Posts: 14
Joined: Mon May 26, 2008 7:17 am
Location: Kolkata

Post 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?
Hi
santanu84
Participant
Posts: 14
Joined: Mon May 26, 2008 7:17 am
Location: Kolkata

Post by santanu84 »

The External Source Stage has not worked......
does any body know any other solution around? :?:
Hi
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

The External Source stage WILL work. Go to Ernie's blog and search for it.
http://dsrealtime.wordpress.com/category/xml/
lstsaur
Participant
Posts: 1139
Joined: Thu Oct 21, 2004 9:59 pm

Post by lstsaur »

For Windows platform, it has problems. What's the error message when you using External Source stage?
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

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

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
santanu84
Participant
Posts: 14
Joined: Mon May 26, 2008 7:17 am
Location: Kolkata

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

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post 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!
santanu84
Participant
Posts: 14
Joined: Mon May 26, 2008 7:17 am
Location: Kolkata

Post by santanu84 »

Hi Friends

Thanks for Help.

It has been done successfully.

Thanks again for this enormous help.


Regards,

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

Post by ray.wurlod »

You might like to mark this thread as Resolved, then.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

Post 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
Thanx
Jaya
jpnrd
Participant
Posts: 19
Joined: Wed May 05, 2010 3:35 pm

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

Post by eostic »

It's all in the thread. Start a new thread and outline what issues you are having.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply