datatype problem

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
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

datatype problem

Post by hargun »

Hi,
i have column name BAL_NAME(decimal 22,2).i have create a dummy file and give the value 345.22 while creating flat file but when in view data its showing 00000000000000000345.22 added zeros in front of values.how to get rid of zeros just want 345.22

Also for column name EFFT_DT (DATE) i enter 2011-04-03 in dummy flat file but its showing values like 40240 .Can someone helps me on this.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage always puts the zeroes in for Decimal data type, to prove that precision and scale are handled properly. You can only get rid of the zeroes if you use VarChar as the data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

use varchar and user trim() to strip the zeros
- Zulfi
sreewin7
Participant
Posts: 41
Joined: Tue Sep 14, 2010 8:48 pm

Re: datatype problem

Post by sreewin7 »

If hope the below answer is enough for your question, if you are still struggling to get your output.

I hope your are using transformtion stage in your job, go to column right click and go to string and you can frind trim and use this.

Regards,
Sree
[quote="hargun"]Hi,
i have column name BAL_NAME(decimal 22,2).i have create a dummy file and give the value 345.22 while creating flat file but when in view data its showing 00000000000000000345.22 added zeros in front of values.how to get rid of zeros just want 345.22

Also for column name EFFT_DT (DATE) i enter 2011-04-03 in dummy flat file but its showing values like 40240 .Can someone helps me on this.[/quote]
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

Post by hargun »

Also for column name EFFT_DT (DATE) i enter 2011-04-03 in dummy flat file but its showing values like 40240 .Can someone helps me on this.[/quote]
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

hargun wrote:Also for column name EFFT_DT (DATE) i enter 2011-04-03 in dummy flat file but its showing values like 40240 .Can someone helps me on this.
[/quote]

you mean to say the seq file holds "2011-04-03" but when you do a view data you see "40240" ?
- Zulfi
hargun
Participant
Posts: 188
Joined: Mon May 16, 2011 7:41 pm
Location: United States

Post by hargun »

Hi zulfi,

Yes when i view data it shows not exactly the same date whech i enters.
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Post by zulfi123786 »

Never trust the data browsers. Create a small job to read from seq file and write to seq file and then see what's written to make sure data is not messed up
- Zulfi
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

zulfi123786 wrote:use varchar and user trim() to strip the zeros
I would suggest the suppress_zero rtype in DecimalToString().
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
sajal.jain
Participant
Posts: 11
Joined: Sat Mar 13, 2010 12:00 am

Post by sajal.jain »

maybe 'yyyy-mm-dd' is not your default DataStage date format? Try with 'dd-mmm-yyyy'
Major GungHo
Post Reply