How to handle EMPTY XML file as Input

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
rohit.agarwalin
Participant
Posts: 11
Joined: Mon Feb 04, 2013 8:03 am

How to handle EMPTY XML file as Input

Post by rohit.agarwalin »

Hi,

I have a requirement where XML file will be provided with full information (with all the tags) and this file may come as EMPTY file as well.
In case of Empty XML file only file header will be present and XML body part will not be present in file (even tags will not be there).

Could you please advise how to handle this kind of file (as EMPTY file may come any day) and I do not want to have a separate job.

So job should be able to handle both FULL and EMPTY (with only Header) XML file.

Thanks,
Rohit.
Thanks & Regards,
Rohit
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

You'll have to play with it...try some different scenarios....not sure if it will get rejected as "not well formed", or just not retreive any data. Is the "header" just the first line of an xml document, <?xml version="1.0" ?> (with nothing else in the file) ....or is it a more formal header "as content" like:

<?xml version="1.0" ?>
<main>
<header>
<stuff/>
</header>

</main

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
arunkumarmm
Participant
Posts: 246
Joined: Mon Jun 30, 2008 3:22 am
Location: New York
Contact:

Post by arunkumarmm »

I dont think that should be a problem. Your job should run fine and extract only the header data.

The detail records, if not found, should finish with zero count.
Arun
Post Reply