Processing XML using external source

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
rager
Participant
Posts: 27
Joined: Tue Jul 17, 2007 11:23 pm
Location: UK

Processing XML using external source

Post by rager »

Hello,

I have been trying to process an XML file with a varying degree of success (mostly failure).

I have managed to create the following parallel job which works fine:

sequential file -> xml input -> sequential file.

I used Record type=implicit and Delimiter=none in the sequential file stage to read the entire file as one row.

The actual file that I will have to process is about 3 MB in size, so the sequential stage is not going to work.

I replaced the sequential file with an external source stage and changed the "Column content" radio button in the XML Input stage to "URL/File Path" from "XML Document". The "Source Program" property in the external source stage contains "ls /user/user23/sample.xml".

The program is running without any errors/warnings, but I am getting 0 rows. I see one row going into the XML input stage but none coming out.

Following are the contents of sample.xml
<?xml version="1.0"?>
<Name>
<FirstName>name1</FirstName>
<FirstName>name2</FirstName>
</Name>


I am sure that I have missed something - some very small thing most likely. Please assist.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Look carefully at the Description property of your output link......you should have something like /Name/FirstName . Anything else would be a typical reason for getting zero rows.

Also...just in case, send your External Source stage link to a sequential file and be sure you are getting the filename as you expect.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
rager
Participant
Posts: 27
Joined: Tue Jul 17, 2007 11:23 pm
Location: UK

Post by rager »

Thank you Ernie. Your blog helped me a lot in getting to where I am now. I got it working in serial too.

I tried all you had mentioned and and it still did not work.

Then... I force compiled the job. Now it works!
Post Reply