xml output file was not created?

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
Agnes
Participant
Posts: 5
Joined: Tue Jun 05, 2007 1:52 pm

xml output file was not created?

Post 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?
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Re: xml output file was not created?

Post 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,
-V
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Agnes
Participant
Posts: 5
Joined: Tue Jun 05, 2007 1:52 pm

Post 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.
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post 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!!!
-V
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

Add this to the description in XML stage/ Input/ columns.

Code: Select all

"/Branches/Branch/@BRCH"
Agnes
Participant
Posts: 5
Joined: Tue Jun 05, 2007 1:52 pm

Post 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]
Agnes
Participant
Posts: 5
Joined: Tue Jun 05, 2007 1:52 pm

Post by Agnes »

thanks Krazy,
I add your recommendation to the descritpion space, but still not working?
VCInDSX
Premium Member
Premium Member
Posts: 223
Joined: Fri Apr 13, 2007 10:02 am
Location: US

Post 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,
-V
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post 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
Post Reply