Page 1 of 1

Omit null columns in XML output

Posted: Fri Mar 22, 2013 4:50 am
by smart2786
is it possible to omit null columns while creating xml from csv file in Datastge8.1 parallel extender? In the sequential file stage ,I can not specify quote and delimiter as 000 as mentioned in this blog.

< split from this post>

Posted: Fri Mar 22, 2013 5:22 am
by eostic
You should start your own thread, but the equivalent settings in a parallel Job are delimiter NONE and quote character NONE.

Ernie

Omit null columns in xml outDatastage 8.1 paralllel extender

Posted: Fri Mar 22, 2013 5:35 am
by smart2786
Hi Ernie,
is it possible to omit null columns while generating xml file in datastage 8.1 parallel edition.I see from this post that it is possible in server.Can you please tell how it can be done in parallel job.In sequential file stage of parallel edition ,i can not specify delimiter and quote as 000

Posted: Fri Mar 22, 2013 6:52 am
by eostic
Maybe someone can split this into its own thread.

These are two different questions. First, the xmlOutput Stage, by default, will not create elements for columns whose condition is truly "null". The elements simply won't be there for that row. If you have name and phone within person for a given row, and they are all present, with values, you'll get:

Code: Select all

<person>
   <name>fred</name>
   <phone>234</phone>
</person>
but if phone is null for a given row, you'll just get:

Code: Select all

<person>
   <name>fred</name>
</person>
The 000 or NONE settings for Server and EE Sequential Stages is simply to write out a file that has no delimiters and no quote characters. Use it when you are sending a single large column of xml content into a Sequential Stage. Often it is useful to send the output of an xml stage (or xmlOutput) to some other stage for further processing. In fact, I recommend that you ONLY process xml this way. If you do, you code doesn't change whether you are writing the xml to sequential file, MQ series, Oracle, DB2, or whatever. Put one big column on the output link of the stage and give it a longvarchar and long length and in xmlOutput Stage, put a single '/' in the Description property. In the xml stage, map the final output from the Composer to your column in the Output Step.

Ernie

Posted: Fri Mar 22, 2013 7:19 am
by chulett
eostic wrote:Maybe someone can split this into its own thread.
Maybe? :wink:

Done.

Posted: Fri Mar 22, 2013 11:07 am
by eostic
Thank you Craig! Bless all you admins...!

Ernie