Char to Deimal Conversion

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
chrisjones
Participant
Posts: 194
Joined: Thu May 11, 2006 9:42 am

Char to Deimal Conversion

Post by chrisjones »

Hi ,
I am getting data as Char (6)from source but in the target the cloumn is Decimal(18).

Ex:Source Data
011944
011954
011964
011974.

I am unable to convert the char to Decimal please help me how to convert this data.
Thanks,
Chris Jones
John Smith
Charter Member
Charter Member
Posts: 193
Joined: Tue Sep 05, 2006 8:01 pm
Location: Australia

Post by John Smith »

Have you tried StringtoDecimal function?
vasa_dxx
Participant
Posts: 39
Joined: Sun Sep 28, 2008 2:59 am
Contact:

Post by vasa_dxx »

This is a duplicate thread of :viewtopic.php?p=302816#302816.

Jones,Please delete /unamrk any one of it, hence there won't be any confusion.

Thanks,
Two wrongs don't make a right. But three lefts do.
chrisjones
Participant
Posts: 194
Joined: Thu May 11, 2006 9:42 am

Char to Deimal Conversion

Post by chrisjones »

Yeah Tried but I am getting all space followed by 5 zeros in Traget.

I execute the same job in my personal laptop in DS 7.5X2 it worked fine..but in my office laptop I am having 7.5.2...because of some reason this StringToDecilam Function Not working....Any idea,why it is not working in DS7.5.2.

Thanks,
Nepal Samala
Thanks,
Chris Jones
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

What the exact expression that you have used?
Do you get partial padding of zeros and spaces?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chrisjones
Participant
Posts: 194
Joined: Thu May 11, 2006 9:42 am

Char to Deimal Conversion

Post by chrisjones »

Yeah..Kumar .I am getting from source as Char(6):123456 but when I am trying to load into Target as Dec(18) using StringToDecimal Function it is getting loaded as 0000000000000000.00.

if I change the datatype as Dec(6) the data is loading as space12345.

The last digit 6 is getting trunacting.Please let me know if u have any idea


Thanks,
Chris Jones

kumar_s wrote:What the exact expression that you have used?
Do you get partial padding of zeros and spaces? ...
Thanks,
Chris Jones
vasa_dxx
Participant
Posts: 39
Joined: Sun Sep 28, 2008 2:59 am
Contact:

Re: Char to Deimal Conversion

Post by vasa_dxx »

chrisjones wrote:Yeah..Kumar .I am getting from source as Char(6):123456 but when I am trying to load into Target as Dec(18) using StringToDecimal Function it is getting loaded as 0000000000000000.00.

if I change the datatype as Dec(6) the data is loading as space12345.

The last digit 6 is getting trunacting.Please let me know if u have any idea


Thanks,
Chris Jones

kumar_s wrote:What the exact expression that you have used?
Do you get partial padding of zeros and spaces? ...
Check for setting max datasize limit in dsadm. There you can specify if Data is to be truncated for oever the limit.
Two wrongs don't make a right. But three lefts do.
chrisjones
Participant
Posts: 194
Joined: Thu May 11, 2006 9:42 am

Re: Char to Deimal Conversion

Post by chrisjones »

Hi ,
Where can I see in dsadmin ,can you tell exactly where to look in dsadmin.

In my personal PC i can see Maximum Decimal Size:18 under Mainframe tab but in my office I could see this option since Mainframe tab is disabled... so you are refering the same Maximum Decimal Size under Mainframe Tab or r u refering some other .Please let me know.

Cheers,
Chris.
vasa_dxx wrote:
chrisjones wrote:Yeah..Kumar .I am getting from source as Char(6):123456 but when I am trying to load into Target as Dec(18) using StringToDecimal Function it is getting loaded as 0000000000000000.00.

if I change the datatype as Dec(6) the data is loading as space12345.

The last digit 6 is getting trunacting.Please let me know if u have any idea


Thanks,
Chris Jones

kumar_s wrote:What the exact expression that you have used?
Do you get partial padding of zeros and spaces? ...
Check for setting max datasize limit in dsadm. There you can specify if Data is to be truncated for oever the limit.
Thanks,
Chris Jones
Post Reply