XML generation Issue

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
nibumathewbabu
Premium Member
Premium Member
Posts: 22
Joined: Thu Jul 05, 2012 5:09 am
Location: Chennai

XML generation Issue

Post by nibumathewbabu »

For generation of new XML I had created an XSD first then created the job like below
Oracle connector>XML>XML_Output
In the edit assembly of XML stage>XML composer step I choose the option as

"Write to File " and provided output file directory and Filename prefix
the issue I am facing is for each input row DS is generating seperate XML output files.(eg:10 XML files for 10 input rows)
My requirement is to generate a single output XML file with all the input values.

Kindly guide me
Thanks
Nibu Mathew Babu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Make sure you did not select 'use trigger column' from the Transformation Settings tab as that will cause the behavior you are seeing. And you don't specify an XML "prefix" but rather the full output path / filename. See if this helps, specifically Step 5.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Craig is correct, regarding xmlOutput.......but there is a different problem.....

You might choose Oracle Connector...to xml (hoerarchical if in a newer release)...

OR.....

Oracle to xmlOutput. There are few if any reasons for both xml stage types.
...

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Didn't notice that, good point.
-craig

"You can never have too many knives" -- Logan Nine Fingers
nibumathewbabu
Premium Member
Premium Member
Posts: 22
Joined: Thu Jul 05, 2012 5:09 am
Location: Chennai

Post by nibumathewbabu »

I changed the XSD and added
minoccurs="0" maxoccurs="unbounded
also
Output -> Mappinng of the XML stage and assigned "top" to the name of the output link

Now only one file is generating but it is only having a single record all other records are missing!! Please help again! :(
Thanks
Nibu Mathew Babu
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you sure everything isn't there? It could be all there as "one long record".
-craig

"You can never have too many knives" -- Logan Nine Fingers
nibumathewbabu
Premium Member
Premium Member
Posts: 22
Joined: Thu Jul 05, 2012 5:09 am
Location: Chennai

Post by nibumathewbabu »

No I Shall explain further

Job1Oracle-4 rows-->XML_Stage-4 rows-->XMl Ouput Stage

Job2 Oracle-4 rows-->XML_Stage-1 row-->Sequential Stage


In job 1 in the edit assembly of XML stage>XML composer step I choose the option as "Write to File " and provided output file directory and Filename prefix
If you see, 4 rows are reaching till xml output file stage but only one row is getting written in target!Not sure what at all happening!


In Job 2 in the edit assembly of XML stage>XML composer step I choose the option as pass as string and provided target sequential file with one column and the first row only getting passed from XML stage!I had followed the similar pattern from IBM sample composing job kit no idea what at all happening!!

I need to get an output for either of above jobs.Please suggest! :(
Thanks
Nibu Mathew Babu
nibumathewbabu
Premium Member
Premium Member
Posts: 22
Joined: Thu Jul 05, 2012 5:09 am
Location: Chennai

Post by nibumathewbabu »

I had created another job design as below

Oracle Connector -->Transformer-->XML output

I had followed exactly which is been said here: http://datawarehouse.ittoolbox.com/grou ... 80-3612038

Job is success with no warnings.But target file is not getting created.Could you suggest some possiliblies? I am looking in the correct target path given in the option stage of XML output
File path:/fl***/FCA***/f***/tmp/test/n**/XML/N**_XML_OP.xml
Thanks
Nibu Mathew Babu
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

replace xml stage with a peek to see if you are getting data.

Look to see if you have write permissions to that path with the user id that is running the job (in case credential mapping is being used).
nibumathewbabu
Premium Member
Premium Member
Posts: 22
Joined: Thu Jul 05, 2012 5:09 am
Location: Chennai

Post by nibumathewbabu »

Thank you!
With Peek am getting data.
But XML its not.But in the same folder I am able to create new files using sequential stage.What may be the reasons then
Thanks
Nibu Mathew Babu
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Build it like this:

Oracle.....Transformer (if needed for any kind of tranform).....xmlOutput......Sequential

On the input link of xmlOutout, out your xml specificatuons in the description property of each column. Like: /mainElement/nextNode/etc/text() .....or similar.... chances are, you have done this part already......

At the output link, have just one single longvarchar column. Call it something like xmlContent. Give it a length such as 99999. Put only a single slash in its description.....and in the transformation settings, use Aggregate. That will force it to collapse all incoming rows into one structure.

In the sequential stage, name your target and use None and None for delimiter and quote character.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
nibumathewbabu
Premium Member
Premium Member
Posts: 22
Joined: Thu Jul 05, 2012 5:09 am
Location: Chennai

Post by nibumathewbabu »

Oops since Its being premium content I cant read it in complete :(
Thanks
Nibu Mathew Babu
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

nibumathewbabu wrote:Oops since Its being premium content I cant read it in complete :(
That's simply solved. Get yourself a premium membership (from the Home page). It IS worth it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply