Page 1 of 1

xml output file was not created?

Posted: Thu Jun 07, 2007 11:44 am
by Agnes
I need help to create an XML output file from a sequential file.

I create a job that reads sequential file and I was able to view the data. When I add in the XML output stage, add in XML defintion (under namespace tab), and ask it to output to a file (under option tab). I compiled and ran the job and it was SU. But I couldn't find the output XML file? And the log offer no help, it said it was all successfull.

I don't know what I am missing?

Re: xml output file was not created?

Posted: Thu Jun 07, 2007 1:12 pm
by VCInDSX
Agnes wrote:output to a file (under option tab)
While setting the output file, make sure you select the folder in which you want the output file to be created.
If you are comfortable with job parameters, setup a parameter for output file path and one for output file name. Set the OutputFilePath parameter of type "Pathname" and use these in the "Options" page of the XML Output stage.

Good luck,

Posted: Thu Jun 07, 2007 1:15 pm
by chulett
It was "SU"? Stuffed Up? :?

If your XPath expressions are not appropriate, it is conceivable that records came into the stage but nothing was generated. Are you certain no output file was created?

Posted: Thu Jun 07, 2007 1:49 pm
by Agnes
Craig,

yeah, it was SU. I check the log and everyline was clean.

I did one extra test, which was output to a sequential file. the sequential file was created.

But when I changed it back to an XML Output file, it showed SU but I didn't see the file created. Sad...

1) I use a very simple file to test....
<record>
<name>John </name>
<address>123 main street </address>
</record>

2) Under Namespace Declaration, I reference a table definition for the XML.

Posted: Thu Jun 07, 2007 3:14 pm
by VCInDSX
Agnes wrote:2) Under Namespace Declaration, I reference a table definition for the XML.
Could you give some more information on how you created the table definition in the first place? Was it using the XML Meta Data Importer and an XSD?

How does your XPath expression looks like on the Transformer's description column? From your test job, it appears that it should not be a lengthy XPath section. Do you mind copying it here? As craig mentioned, it will help in investigating the issue.

Cheers!!!

Posted: Mon Jun 11, 2007 9:43 am
by Krazykoolrohit
Add this to the description in XML stage/ Input/ columns.

Code: Select all

"/Branches/Branch/@BRCH"

Posted: Mon Jun 11, 2007 10:36 am
by Agnes
Sample extract:
<shiporder orderid="889923"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="shiporder.xsd"> ....

I have imported my xsd file (eg: sample_data.xsd) to the dstage server under the folder table_definition.

Can someone help me to customize the xmlns and xsi statements?
xmlns:xsi=??
xsi=??

I think I have it wrong, so I don't have the XML file output.....

[/img]

Posted: Mon Jun 11, 2007 10:37 am
by Agnes
thanks Krazy,
I add your recommendation to the descritpion space, but still not working?

Posted: Mon Jun 11, 2007 11:36 am
by VCInDSX
Krazykoolrohit wrote:Add this to the description in XML stage/ Input/ columns.

Code: Select all

"/Branches/Branch/@BRCH"
Hi,

What does this XPath expression do?
Is this attribute "BRCH" a part of the xml sample schema/document that "Agnes" is referring to or is this a debugging element in Datastage?
What should be the input value for this element?

Agnes,
Not sure about your R&D with Datastage, please refer to this link http://www-128.ibm.com/developerworks/d ... 0703xiong/ that has a "step-by-step" XML generation tutorial.
Thanks to vmcburney for collecting these links...
If you want to post any snapshots or screenshots of your job, you may need to upload them to an image hosting site and provide the link.

Good luck,

Posted: Tue Jun 12, 2007 2:21 pm
by Krazykoolrohit
VCInDSX wrote:
Krazykoolrohit wrote:Add this to the description in XML stage/ Input/ columns.

Code: Select all

"/Branches/Branch/@BRCH"
Hi,

What does this XPath expression do? This creates the XML data in avirtual tabular form. Is this attribute "BRCH" a part of the xml sample schema/document that "Agnes" is referring to or is this a debugging element in Datastage? Nothing. Its just an example. You can give any value you want. but you need atleast two / and @ to denote the column nameWhat should be the input value for this element?

Agnes,
Not sure about your R&D with Datastage, please refer to this link http://www-128.ibm.com/developerworks/d ... 0703xiong/ that has a "step-by-step" XML generation tutorial.
Thanks to vmcburney for collecting these links...
If you want to post any snapshots or screenshots of your job, you may need to upload them to an image hosting site and provide the link.

Good luck,
agnes,

just put the XML output stage and map your output streams to it. Add the file path and for all columns change data element to XML and in column description add the text i gave you. this should be able to create a simple XML.

If still not successfull, then you may find it helpfull to read the XML support doc installed with datastage