Page 1 of 1

Warning when using ODBC in a custom routine

Posted: Thu May 22, 2014 10:29 am
by MrBlack
I have written a custom routine that uses the ODBC driver. Everything in the routine works fine and I can get my results back. The issue I'm having is the routine throws this warning:

Code: Select all

[IBM(DataDirect OEM)][ODBC Oracle driver]The DataDirect product you are attempting to access has been provided to you by IBM Corporation for exclusive use with IBM InfoSphere Information Server.  You are not licensed to use this product with any application other than IBM InfoSphere Information Server.   If you would like to purchase this product for some other use, please call 800-876-3101 or visit DataDirect at www.datadirect.com
Which isn't an issue until in a sequence stage, on the properties, I select "Automatically Handle Activities that Fail". If this box is selected, the job will always go to the exception handler even though the routine really did execute fine, there's just this warning being thrown.

Does anyone know what I can do to either get ride of this warning or a way to make it so datastage doesn't send my job to the exception handler?

Posted: Thu May 22, 2014 6:02 pm
by ray.wurlod
The DataDirect drivers have a 30 day grace period for use other than from DataStage stages, after which they expect you to purchase a licence (not cheap). Your routine will stop connecting to the data source 31 days after first use.

Posted: Fri May 23, 2014 8:27 am
by MrBlack
I think I'm getting a little closer, I've modified my routine a bit to included these lines:

Code: Select all

$INCLUDE UNIVERSE.INCLUDE ODBC.H  **this line was already there**
DEFFUN DSAttachODBCDriver(hdbc)   **added this line**

RSTATUS = SQLConnect(hdbc,DSN,UID,PWD)  **this line was already there**
RSTATUS = DSAttachODBCDriver(hdbc)      **added this line**
So now all the warnings are gone. Now when I run the routine in a Routine Stage I get this warning:

Code: Select all

Get_Sysdate..JobControl (@Routine_Activity_0): Routine DSU.GetValFromSQL did not finish OK, return code = '2014-05-23 08:19:20'
Which kind of makes sense, so now I need to figure out if it's possible to set the return code to what I assume should be '1' but to see if there is something like a return value parameter to deliver the return value from my sql statement for use in my job.

Posted: Fri May 23, 2014 9:14 am
by chulett
Any routine that does not return a zero is assumed to have failed when you have that "Automatically handle" option enabled. You have to explicitly handle the "failure" so it (the sequence job) doesn't think it needs to handle it for you.

The help text for that option explains the issue and exactly how to do that.