Warning when using ODBC in a custom routine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

Warning when using ODBC in a custom routine

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

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

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply