Omit null columns in XML output

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
smart2786
Premium Member
Premium Member
Posts: 14
Joined: Sun Mar 11, 2007 10:16 pm
Location: India

Omit null columns in XML output

Post 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>
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

You should start your own thread, but the equivalent settings in a parallel Job are delimiter NONE and quote character NONE.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
smart2786
Premium Member
Premium Member
Posts: 14
Joined: Sun Mar 11, 2007 10:16 pm
Location: India

Omit null columns in xml outDatastage 8.1 paralllel extender

Post 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
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

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

eostic wrote:Maybe someone can split this into its own thread.
Maybe? :wink:

Done.
-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 »

Thank you Craig! Bless all you admins...!

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply