Tuncating zeros in XML output stgae

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
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Tuncating zeros in XML output stgae

Post by sri75 »

Hi ,



When I write data (input filed (9,2) ) to XML output stage (target filed (9,2)), the trailing zeros were truncated. I did check with dataset as output stage, it retained trailing zeros.

Can you please let me know how to hande this before I send data to XML.

Thanks
Sri
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Define the field as varchar of appropriate length in target XML output stage
You are the creator of your destiny - Swami Vivekananda
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

Thanks anbu for your reply.It did work, but I need to truncate leading zeros. when I tried with decimaltostring function it is truncating both leading and trailing zeros.
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Code: Select all

Trim(Field,'0', 'L')
You are the creator of your destiny - Swami Vivekananda
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

sri75 wrote:Thanks anbu for your reply.It did work, but I need to truncate leading zeros. when I tried with decimaltostring function it is truncating both leading and trailing zeros.
You might want to post the syntax you were using for this.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply