How to Achieve integer value with out exponential value

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
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

How to Achieve integer value with out exponential value

Post by somu_june »

Hi,

Can any one help me. I have a stage variable totalpriceval. In properties of stagevariable I mentioned precision as varchar 255 . Iam getting frm source flat file price as char[15] to stage variable . Ex

variable expression
totalprcval If frm_src.recindicator='2' then totalprcval+As integer (frm_src.price) else totalprcval.

I gave in stage variable proprerties
name initalvalue

totalprcval 0 varchar 255

In output Iam getting as 2.72922e+11. I want output as 272922234556 as integer with out exponential . What I have to do to achieve integer value.

Thanks,
Somaraju
somaraju
tardifma
Premium Member
Premium Member
Posts: 23
Joined: Tue Jan 24, 2006 10:53 am

Post by tardifma »

Why don't you use a real integer variable? You could convert your string input field to an integer by using the StringToDecimal function.

Mathieu
The Brute
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Mathieu,

Please correct me if I understood your reply wrong. I have to give in stage variable properties totalprcval precision as int 64 and in expression of stage variable in place of As integer I have to give string to decimal function.




Thanks,
Somaraju
somaraju
tardifma
Premium Member
Premium Member
Posts: 23
Joined: Tue Jan 24, 2006 10:53 am

Post by tardifma »

Hi,
What I am saying is if you input is something like '27292223455' (Varchar(15)), then you could define your variables as BigInt and convert it to a number by using the DecimalToString function...

Is this what you try to do? or if your input have the 2.72922e+11 format as well?

Mathieu
The Brute
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Hi Mathieu,


I gave in stage properties stage variable totprcval sql type as bigint . I got my output with out any exponentional value . Thanks for solving my problem.





Thanks,
Somaraju
somaraju
Post Reply