Problem with XML job

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

nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Post by nani1974 »

Hi Ernie,
Now the job is running but the data is not loading into file, because i added the fields manually in the output of second XML Input stage and added the description as same as input field so that would be the problem you think,,any suggestions ernie

Thank you
Kumar
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

How well did it work when you had separate jobs?

Don't try to do this unless you first have a job that successfully pulls content in the first XMLStage and sends it to a file, and then a second job that successfully parses that resulting file.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Post by nani1974 »

Ernie,
Its working fine when i run the seperate job with single XML stage and writing into a file , but not working with two XML stages, data is coming untill second XML stage but not writing out.

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

Post by eostic »

So now, write a separate second job that reads your file from the first Job (use a Server Job for testing and use a Folder Stage), and passes it to an XMLInput and parses it. Get that working perfectly before you try to put the two xmlInput Stages together.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Post by nani1974 »

Ernie,
No luck, getting same result as my previous job, when i enable 'use custom stylesheet and get stylesheet from input column' then only the job is running with out output data but if i disabled that then i am getting this error ....
Abnormal termination of stage DEBUG2..XML_Input_1 detected

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

Post by eostic »

? Don't introduce extra complexity. Treat this as a normal process. You have a file that you received from the output of the first Job.

Is it xml?
Can you open it in IE?

Now, import the metadata for it. Perfectly usual process. Save some table definitions for it. ....etc. Don't use custom stylesheets at this point...that is vastly more complex than anything we're seeing that you would require here.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Post by nani1974 »

Ernie,
It is 'XML" only and i can open it in IE, coming to job i mentioned earlier as i have entered fields manually in the output is that a problem you think,because i dont have any fields to import from table definations. i have only the XML file structure which i am using as source
Here is the 'XML' file structure,they just asked me to use those fields in output what ever we have in the file,thats why i am entering all the fields manually in the output link.

<?xml version="1.0"?>
<CompressableData>
<PMxml><ProductsAndRelations xmlns="http://tempuri.org/ProductsAndRelations.xsd">
<Cart HC_ID="-9" PKG_HC_ID="0" CONTRACT="" FID_NAME="193" QUANTITY="1" STATUS="Void" ACTION="10" HC_CATEGORY="" HC_SUB_CATEGORY="" MODIFIED_BY="System" FOR_DISPLAY="true" HC_SUB_CHOICE="" TN="7032410215" BUN_HC_ID="0" RC="0" NRC="0" MIN_FP="0" MAX_FP="0" NAME="Online Activation Fee Waiver - FiOS Internet" USOC_IOSC="" LS_HC_ID="" DESCRIPTION="" />
<Cart HC_ID="-9" PKG_HC_ID="0" CONTRACT="" FID_NAME="245" QUANTITY="1" STATUS="Void" ACTION="10" HC_CATEGORY="" HC_SUB_CATEGORY="" MODIFIED_BY="System" FOR_DISPLAY="true" HC_SUB_CHOICE="" TN="7032410215" BUN_HC_ID="0" RC="0" NRC="0" MIN_FP="0" MAX_FP="0" NAME="Online Installation Fee Waiver" USOC_IOSC="" LS_HC_ID="" DESCRIPTION="" />
<Cart HC_ID="-7" PKG_HC_ID="21664933" CONTRACT="" FID_NAME="245" QUANTITY="1" STATUS="Add" ACTION="0" HC_CATEGORY="" HC_SUB_CATEGORY="" MODIFIED_BY="System" FOR_DISPLAY="true" HC_SUB_CHOICE="" TN="7032410215" BUN_HC_ID="0" RC="0" NRC="-79.99" MIN_FP="0" MAX_FP="0" NAME="Online Installation Fee Waiver" USOC_IOSC="H4782" LS_HC_ID="" PRODUCT_TYPE="DISCOUNT" BSOFFER_ID="OF10000228" BSPROMO_ID="PR10000100" COUPON="" />
</ProductsAndRelations></PMxml>
</CompressableData>

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

Post by eostic »

I'm not quite sure where else to point you. The answers are all in the threads above.

Let's look at your string more closely:

<?xml version="1.0"?>
<CompressableData>
<PMxml><ProductsAndRelations xmlns="http://tempuri.org/ProductsAndRelations.xsd">
<Cart HC_ID="-9" PKG_HC_ID="0" CONTRACT="" FID_NAME="193" QUANTITY="1" STATUS="Void" ACTION="10" HC_CATEGORY="" HC_SUB_CATEGORY="" MODIFIED_BY="System" FOR_DISPLAY=


What this "really" is, is a chunk of xml: <ProductsAndRelations>... ...that happens to be "stuck" inside of another xml called <PMxml>.

Goal number one is simply to extract that inner chunk. That is what Job1 needs to do.

Look up above where I specified the SINGLE column on the output link of your XMLInput Stage for that first Job. Send that column to a Sequential Stage (be sure there is no formatting, no quotes, no commas, nothing). Look at it. If it doesn't look like nice xml with <ProductsAndRelations>, then stop, because something is still broken. If it looks like nice clean xml, then you can move forward.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Post by nani1974 »

Ernie,
Thank you very much for your kindness and help.
I did exactly waht you told step by step i wrote into a Sequential file as a single row, i finished goal no one and i am trying to extract the data from a Seq file in second job as folder-xmlinput-transformer-seqfile but i am not able to do it because i am getting the error in the second job ...
'Abnormal termination of stage DEBUG2..XML_Input_1 detected'
so you think there is a problem with file itself...i am losing my pateience with this job,,,,,any way thanks once again for your help.

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

Post by eostic »

First tell me if you can open your resulting flat file in IE? or at the very least, in Notepad....does it look like nice clean XML?
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
pillip
Premium Member
Premium Member
Posts: 50
Joined: Thu Dec 10, 2009 10:43 am

Post by pillip »

I have a similar issue , i want to embed one xml into another.
I have been successful in creating the first xml by using '/'. I put this in the sequential file and the xml got created fine. Now I want to embed this xml in start and end tags.
I used another xml output stage, but was unable to get the output fine. Kindly let me know what xpath expression i need to use to get the required output.

Thanks.
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Post by nani1974 »

Ernie
Here is sample flat file XML which i can open in notepad but not in IE,

"<ProductsAndRelations xmlns=""http://tempuri.org/ProductsAndRelations.xsd"">
< HC_ID=""-9"" PKG_HC_ID=""0"" CONTRACT="""" FID_NAME=""193"" QUANTITY=""1"" STATUS=""Void"" ACTION=""10"" HC_CATEGORY="""" HC_SUB_CATEGORY="""" MODIFIED_BY=""System"" FOR_DISPLAY=""true"" HC_SUB_CHOICE="""" TN=""7032410215"" BUN_HC_ID=""0"" RC=""0"" NRC=""0"" MIN_FP=""0"" MAX_FP=""0"" NAME=""Online Activation Fee Waiver - FiOS Internet"" USOC_IOSC="""" LS_HC_ID="""" DESCRIPTION="""" />
< HC_ID=""-9"" PKG_HC_ID=""0"" CONTRACT="""" FID_NAME=""245"" QUANTITY=""1"" STATUS=""Void"" ACTION=""10"" HC_CATEGORY="""" HC_SUB_CATEGORY="""" MODIFIED_BY=""System"" FOR_DISPLAY=""true"" HC_SUB_CHOICE="""" TN=""7032410215"" BUN_HC_ID=""0"" RC=""0"" NRC=""0"" MIN_FP=""0"" MAX_FP=""0"" NAME=""Online Installation Fee Waiver"" USOC_IOSC="""" LS_HC_ID="""" DESCRIPTION="""" />
< HC_ID=""-9"" PKG_HC_ID=""0"" CONTRACT="""" FID_NAME=""293"" QUANTITY=""1"" S

Thanks
Kumar
pillip
Premium Member
Premium Member
Posts: 50
Joined: Thu Dec 10, 2009 10:43 am

Post by pillip »

I have a similar issue , i want to embed one xml into another.
I have been successful in creating the first xml by using '/'. I put this in the sequential file and the xml got created fine. Now I want to embed this xml in start and end tags.
I used another xml output stage, but was unable to get the output fine. Kindly let me know what xpath expression i need to use to get the required output.

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

Post by eostic »

nani....set your Seq stage in Job1 so that it has NONE as the delimiter and NONE as the quote character.

pillip....probably makes sense to start another thread, but find the xml best practices document elsewhere in the forum, at kim duke's site....it has lots of info on using xmloutput and the xml data element to put "previously created" content into a target.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
nani1974
Premium Member
Premium Member
Posts: 52
Joined: Fri Aug 31, 2007 10:59 am

Post by nani1974 »

Ernie,
I set it as none run the job and my output is.........
<ProductsAndRelations xmlns="http://tempuri.org/ProductsAndRelations.xsd">
< HC_ID="-9" PKG_HC_ID="0" CONTRACT="" FID_NAME="193" QUANTITY="1" STATUS="Void" ACTION="10"
HC_CATEGORY="" HC_SUB_CATEGORY="" MODIFIED_BY="System" FOR_DISPLAY="true" HC_SUB_CHOICE="" TN="7032410215"
BUN_HC_ID="0" RC="0" NRC="0" MIN_FP="0" MAX_FP="0" NAME="Online Activation Fee Waiver - FiOS Internet" USOC_IOSC=""
LS_HC_ID="" DESCRIPTION="" />

When i try to run the second job with this output i am getting same error..
'Abnormal termination of stage DEBUG2..XML_Input_1 detected'

Thanks
Kumar
Post Reply