Page 1 of 1

Arithmetic functions for String datatype using stagevariable

Posted: Wed Mar 21, 2012 5:10 am
by kirankumarreddydesireddy
Hi

We are using Datastage 7.5v server edition on Windows machine.

Before writing this,we have gone through the similar threads in this forum and came to conclusion that the string datatypes will automatically handle arithmetic functions in server jobs.

we had tested this and it worked fine.

we will let you know what we tested :

We had populated '2011' - 1(in the derivation) to output varchar datatype and it gave me the output as 2010 without any warning.we also tried ('2011' - '01').everything worked fine.

Issue :

In our case :

We had the stage variable(StgVarYear) which contains the month and year value (ex :062011)

When we had populated StgVarYear[3,4] - 1 (in the derivation) to output varchar datatype it gave me the correct output as 2010 with the below warning:

DataStage Job 1289 Phantom 6136
Program "JOB.222697345.DT.161513500.TRANS1": Line 381, Nonnumeric data when numeric required. Zero used.
DataStage Phantom Finished

We had tried different options StgVarYear[3,4] - '01',StgVarYear[3,4] - 01.All of them gave the correct result but with the above warning.

Can anyone please let me know, what we need to do(any conversion) to overcome this warning?



Thanks
Kiran

Posted: Wed Mar 21, 2012 7:04 am
by chulett
Are you certain that your stage variable always contains 6 numeric digits?

Posted: Wed Mar 21, 2012 9:53 am
by kirankumarreddydesireddy
Thanks Chulett.

you are correct,we are not certain that it contains always 6 digits.
We have padded '0' for the month to make sure that the StaVarYear always contains 6 digits.

It had resloved the problem.


Thanks
Kiran