how to handle missing tags xml 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
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

how to handle missing tags xml file ?

Post by synsog »

The tags in red are not coming from input XML file, sometimes they come and sometimes they wont come. This is a example, not particularly a contact will not come,, some times limit tags may come may not come. How to handle the xml parsing int his situation ????

If XML file is like below;

<ns7:type>Liability</ns7:type>
- <ns7:Coverages>
- <ns7:Coverage>
<ns7:type>Road Coverage</ns7:type>
<ns7:effectiveFromDate>2012-03-21-04:00</ns7:effectiveFromDate>
<ns7:effectiveToDate>2013-03-21-04:00</ns7:effectiveToDate>
<ns7:description>$50,000/100,000</ns7:description>
- <ns7:Limits>
- <ns7:Limit>
<ns8:amount>100000</ns8:amount>
<ns7:limitType>Incident</ns7:limitType>
</ns7:Limit>
- <ns7:Limit>
<ns8:amount>50000</ns8:amount>
<ns7:limitType>Person</ns7:limitType>
</ns7:Limit>
</ns7:Limits>
- <ns7:Premiums>
- <ns9:Premium>
- <ns9:AnnualPremium>
- <ns9:Amount>
<ns8:amount>700.00</ns8:amount>
</ns9:Amount>
</ns9:AnnualPremium>
- <ns9:NetPremium>
- <ns9:Amount>
<ns8:amount>700.00</ns8:amount>
</ns9:Amount>
</ns9:NetPremium>
- <ns9:NetOnBooksPremium>
- <ns9:Amount>
<ns8:amount>700.00</ns8:amount>
</ns9:Amount>
</ns9:NetOnBooksPremium>
</ns9:Premium>

</ns9:QuoteOption>
</ns9:QuoteOptions>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So... you are saying that sometimes the elements in red may not exist in the file? I don't recall that being a problem. What exactly do you mean by it is "not able to parse incomplete file"? What error(s) are you getting?
-craig

"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

Yes, they may exists or may not exists; I am getting the fatal errors as below;

xmlSrcReadXmlFile,0: Caught unknown exception from runLocally().
xmlSrcReadXmlFile,0: The runLocally() of the operator failed.
xmlSrcReadXmlFile,0: Operator terminated abnormally: runLocally() did not return APT_StatusOk
hellboy
Participant
Posts: 34
Joined: Tue Sep 01, 2009 12:22 am
Location: kolkata

Post by hellboy »

It should not be any problem , just define all the tags properly and try to uncheck the initial validation option ... it will parse the file properly , datastage treats unavailable tags as optional tag and put blank in the respective column.

Regards
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What exact 8.x version do you have and are you current on fixpacks / patches / whatever? And for grins, please confirm that when nothing is missing from the file you do not get any errors.
-craig

"You can never have too many knives" -- Logan Nine Fingers
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

Hi, In XML INPUT Stage , under Stage tab - Validate input XML box is unchecked only, I defined all the tags properly .. around 450 xml files are parsing successfully, only the xml files which donot have all tags are failing. I defined the columns as Nullable No;
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

Chulett: This is 8.7v; Yes, around 450 xml's are processing successfully without any single warning/error, only few xml files, where the tags are missing are getting faling.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

there's not enough of a chunk there....the coverages element didn't seem to close....

nevertheless, in this screen shot of xml, there are clearly multiple independent paths ...one for limits perhaps, and another for premiums? I can't tell because it doesn't look like a complete xml and it's only a screen shot from a browser (notice the dashes) and not the actual xml itself.

Handling nulls is something that is done at both the base level for a row and also at the repeating group....and it depends on the repetition element setting.

let's keep reviewing...it's more complicated than what has been outlined so far.

Ernie
Ernie Ostic

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