How to use XML file as a source file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Gopalraja
Participant
Posts: 18
Joined: Wed Jun 18, 2008 3:51 am
Location: Chennai

How to use XML file as a source file

Post by Gopalraja »

Hi,
In my job XML file is used as a source. I want to know how to get the data from this XML file and load it to target table or csv file format.

Could you pls help me out...

Thanks in Advance...
Aswice
Last edited by Gopalraja on Wed Apr 15, 2009 11:50 pm, edited 1 time in total.
Gopalraja
Participant
Posts: 18
Joined: Wed Jun 18, 2008 3:51 am
Location: Chennai

How to use XML file as a source file

Post by Gopalraja »

Hi,

Anybody know how to use the XML file as a source...


Aswice
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post by jhmckeever »

Hi,

There are a number of ways, depending upon your requirements, although the easiest will almost certainly be to use the XML Input stage. <a href="search.php">Search</a> for it on dsxchange.

You can also read Ernie's excellent blog entry on the topic: http://dsrealtime.wordpress.com/2007/12 ... -a-source/

An alternative I have also used (for a variety of reasons) is to use an External Source stage and flatten the XML using an externally-defined XSL stylesheet. I'd stick with the XML Input stage.

John.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: How to use XML file as a source file

Post by chulett »

Gopalraja wrote:Anybody know how to use the XML file as a source...
Yes, of course. However, you need to learn patience - you bumped your post again after what - 30 minutes? Give me a break. You're lucky John was able to respond as quickly as he did, don't come to expect it though. :evil:
-craig

"You can never have too many knives" -- Logan Nine Fingers
saqib
Participant
Posts: 14
Joined: Mon Jul 27, 2009 12:01 pm
Location: mumbai

Re: How to use XML file as a source file

Post by saqib »

Gopalraja wrote:Hi,
In my job XML file is used as a source. I want to know how to get the data from this XML file and load it to target table or csv file format.

Could you pls help me out...

Thanks in Advance...
Aswice
As said by jhmckeever you need to look for the 'XML input' stage in DS8.0.
Import the table definition for respective xml file.
your parallel job will atleast have the following stages,

row generator-->xfm1-->xml input-->xfm2-->sequential fle

In xfm1 give the path of your xml file in derivation of the column that will be mapped from row generator stage.

In the xml input stg under input pg>xml source>column content select URL/file path.
Load the table definition in the output pg which was imported in the begining.

In the sequential file stg, set the field delimiter as 'comma' to get the o/p in csv format

Kindly let me know if i missed out anything

cheers!!
dspradeep
Participant
Posts: 59
Joined: Fri Aug 21, 2009 12:58 am

Post by dspradeep »

what u mean <B> xfm1 </B> in the below


row generator-->xfm1-->xml input-->xfm2-->sequential fle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please strive for a professional standard of written English here on DSXchange; it makes life easier for those whose first language is not English, and shows respect for other posters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

"xfm" would mean a transformer stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dspradeep
Participant
Posts: 59
Joined: Fri Aug 21, 2009 12:58 am

Post by dspradeep »

can u tell me how to use

Rowgenerator--> Transaformer stage here

bcz i have developed the job like

seqfile-->xml input --> oraclestage

now i am facing one problem like if i got a file with above 7kb then job get aborted so i am looking other solution .

if my understanding is correct for your design is

Rowgenerator -->for dummy purpose
Transaformer -->you are passing path info

let me try whether it will solve my issue.

everyone said we have to use External source stage but my server is in windows so i am facing some issue in that stage. i believe we need to install 7.5x.2 ESS patch in my server mechine for ESS.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Please start your own post, and stop asking U for help.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply