Appending leading Zeros and writting to excel file

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
neo637
Participant
Posts: 9
Joined: Thu Jul 31, 2008 2:56 am

Appending leading Zeros and writting to excel file

Post by neo637 »

Hi,

I am trying to generate excel file in data stage.
In doing so i have a problem, When i am trying to append leading Zeros to a filed and witting into excel file all the leading zeros are stripped off.

Can some one help ma in solving this.

Thanks in advance.
Pagadrai
Participant
Posts: 111
Joined: Fri Dec 31, 2004 1:16 am
Location: Chennai

Re: Appending leading Zeros and writting to excel file

Post by Pagadrai »

neo637 wrote:Hi,

I am trying to generate excel file in data stage.
In doing so i have a problem, When i am trying to append leading Zeros to a filed and witting into excel file all the leading zeros are stripped off.

Can some one help ma in solving this.

Thanks in advance.
Hi,
You can try using quotes for the fields so that the leading zeros are preserved in the output.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Format the cells in the worksheet so that leading zeroes are displayed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

This is a common problem for anyone creating 'Excel' files which a search here or a quick Google would turn up... and one not easily solved. Without a pre-formatted target and the GUI, Excel will always convert anything that looks like a number to a number during an import and remove any non-significant things like leading zeroes.

For csv files, the 'trick' is to create the files as .txt files and teach the user how to force the import to use Text for the field(s) in question to preserve any leading zeroes.

http://excel.tips.net/Pages/T002588_Han ... Files.html
-craig

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