Arithmetic functions for String datatype using stagevariable

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kirankumarreddydesireddy
Participant
Posts: 110
Joined: Mon Jan 11, 2010 4:22 am

Arithmetic functions for String datatype using stagevariable

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Are you certain that your stage variable always contains 6 numeric digits?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kirankumarreddydesireddy
Participant
Posts: 110
Joined: Mon Jan 11, 2010 4:22 am

Post 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
Post Reply