Space in decimal number

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
raju4u
Participant
Posts: 56
Joined: Thu Dec 13, 2007 12:30 am

Space in decimal number

Post by raju4u »

Hi all,

I am genarating fixed with file and that file contains 2 columns.

Uniq char(4),Amt decima(8,2)


Output file i am getting is :
aaaa 000001.12
bbbb 000011.23

Required Output should be without space:
aaaa000001.12
bbbb000011.23

The problem here is Before decemal coumn i am getting one extra space.
I need to remove that space bec this is a fixed with file.
I tried many option with Stripwhitrspace and Trim functions,but still it is not removing.
Here I should not convert it in to Char ,it should be Decimal only.
Please help me on this.
N R REDDY
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The space is the sign character. The only way you can lose it is to convert the data type to Char (or VarChar) and strip the white space.
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

Re: Space in decimal number

Post by chulett »

raju4u wrote:Here I should not convert it in to Char ,it should be Decimal only.
Yes, you should. Flat files are just character data after all. Of course, make sure you're still writing out a valid decimal value but as noted, convert it to a string so you have full control over the formatting.
-craig

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