Page 1 of 1

Div (Mod) function usage in DataStage job

Posted: Thu Oct 28, 2010 7:21 am
by sharkbait1211
Hi all :)

I am creating a server job and have encountered the below error message when debugging:

[IBM][CLI Driver][DB2/NT] SQL0440N No authorized routine named "DIV" of type "FUNCTION" having compatible arguments was found. SQLSTATE=42884

Here is the piece of code for the SQL statement using DIV function:

SELECT ...
FROM ...

WHERE PERIOD > ( ( DIV(#p_PERIOD# , 100) - 1) * 100 + MOD(#p_PERIOD# , 100) )

(p_PERIOD is declared as one of the parameters in Job properties)

Any ideas and/or instructions to previous related posts would be very much appreciated!

Many thanks,

SB

Posted: Thu Oct 28, 2010 7:39 am
by chulett
Sounds like Div() isn't valid for your database or the data types are wrong. Why not just use the normal "/" operator?

Posted: Thu Oct 28, 2010 8:21 am
by sharkbait1211
chulett wrote:Sounds like Div() isn't valid for your database or the data types are wrong. Why not just use the normal "/" operator?

thanks craig (chulett) for your response
the data type is correct, but you may be right as I've tried to run the query in Toad and it seems Div() is not valid with our DB2. I will need to check it again later. Now I will try some alternatives to make the DS job work first

Thanks again for ur help!

SB