Decimal fields are putting a leading space by default

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
shilpa79
Participant
Posts: 131
Joined: Thu Jan 20, 2005 5:59 pm
Location: Virginia

Decimal fields are putting a leading space by default

Post by shilpa79 »

Its a decimal field with (10,2). I want to remove the spaces inbetween them
Sample data:
2006093033 001 0000000000.00 0002055498.78 0000018615.46
2006093061 001 0000000000.00 0000000000.00 0000801466.59
2006093062 001 0000000000.00 0000000329.00 0000216546.21
2006093033 002 0000000000.00 0000166177.06 0000000173.07
2006093061 002 0000000000.00 0000021250.35 0000053596.18
2006093062 002 0000000000.00 0000000018.03 0000036382.91
Last edited by shilpa79 on Thu Nov 09, 2006 5:18 pm, edited 3 times in total.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Can you give an sample of how your output data should look?
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
shilpa79
Participant
Posts: 131
Joined: Thu Jan 20, 2005 5:59 pm
Location: Virginia

Post by shilpa79 »

decimal fields are putting a leading space by default.
The data should look like this:
20060930none33none002none00000000.0000none00166177.0598none0000173.071
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Finally I fished out the input that relates to your output

Input

Code: Select all

2006093033 002 0000000000.00 0000166177.06 0000000173.07 
Output

Code: Select all

20060930none33none002none00000000.0000none00166177.0598none0000173.071


I dont see a direct way of getting to your output

What are the rule for your transformation? More information please.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
shilpa79
Participant
Posts: 131
Joined: Thu Jan 20, 2005 5:59 pm
Location: Virginia

Post by shilpa79 »

Thanks for the result but my questionis how to remove the default leading space that it puts for the decimal fields
I was using none for testing
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The leading space is for the sign character. You can only remove it by converting the data type to VarChar and applying a function such as TrimF to it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
shilpa79
Participant
Posts: 131
Joined: Thu Jan 20, 2005 5:59 pm
Location: Virginia

Post by shilpa79 »

It worked ray :D .

Thanks a lot for all your help.
Last edited by shilpa79 on Thu Nov 09, 2006 6:23 pm, edited 1 time in total.
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Post by Dsnew »

shilpa79 wrote:It worked.

Thanks a lot for your help.

Can you please let everyody know, how you solved it?
shilpa79
Participant
Posts: 131
Joined: Thu Jan 20, 2005 5:59 pm
Location: Virginia

Post by shilpa79 »

I have changed the sqltype to varchar and used the function in the col derivation Decimaltostring
Post Reply