Parsing multiple XML files

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

Moderators: chulett, rschirm, roy

Post Reply
rroy2
Participant
Posts: 21
Joined: Thu Jan 03, 2008 4:16 pm

Parsing multiple XML files

Post by rroy2 »

Hi,

I have to parse multiple XML files named as replyfile*.xml (using wildcard as the files have a datetime stamp in the name).

I tried 2 designs

1.
External Source Stage -----> XML Input stage ------> SEQL file

and gave following command in external source stage: ls /directory/replyfile*.xml

Although it did send the required filenames to XML Input stage but the XML stage could not parse multiple files and gave 0 records as output.(XML Source set as 'filepath')

2.
SEQL File stage ------> XML Input stage -------> SEQL File stage

The first SEQL file stage is to read XML file pattern (i.e. all the files together in one go).....but again the XML Input stage could not parse it.

Is there any property which I am missing here, or something I am not doing correctly? If its one file the parsing is successful using Design 1, so no problem with the xpaths.
OR is there a better approach to process multiple files (note: I am not allowed use loops in job sequencer)

Thanks
roy
jatayl
Premium Member
Premium Member
Posts: 47
Joined: Thu Jan 19, 2006 11:20 am
Location: Rogers, AR

Post by jatayl »

First I would say, Post this under the correct Forum since it is a EE related design.

Actually, I've designed a job using both the external source stage and the sequential file stage. I would probably stick with the sequential file stage. You just need to pass the path name of the actual xml file, and then reference that path in the URL/Path Name for the input. Your output will contain the xpaths for the data you want to parse. Just make sure you use a repetitive field.

Jason
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Make sure that you can at least read "one" of the files...and if you are not getting any errors, but zero rows, review your XPath carefully...it's nearly always the ultimate culprit.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
rroy2
Participant
Posts: 21
Joined: Thu Jan 03, 2008 4:16 pm

Post by rroy2 »

Thx Ernie....

Yeah it was a very minor problem with the xpaths. Works fine now.

Thanks
roy
Post Reply