before job subroutine

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
Arthur
Participant
Posts: 18
Joined: Thu Oct 11, 2007 4:12 am

before job subroutine

Post by Arthur »

Hi!

How to create a before job subroutine that will handle bunch of DML statements and stored porcdures.

Thanks in advance!
--ArThUr
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In the Routines branch of your Repository create a new routine and ensure that its type is Before/After Subroutine.

Within the subroutine, code in DataStage BASIC and use the BASIC SQL Client Interface, or BCI, functions to mimic operation of the ODBC API.

Search the forum for examples.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Arthur
Participant
Posts: 18
Joined: Thu Oct 11, 2007 4:12 am

Post by Arthur »

Hi!ray.wurlod

I have created a user defined before job subroutine. I want to know how to embed stored procedures and SQL DML statements in a single before job sub routines.
--ArThUr
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You use SQLExecDirect() or SQLExecute() (for prepared SQL) functions.

There is a lot of structure you have to set up around this, to bind parameters and bind result columns, allocate memory for managing the environment and freeing the same, connecting and disconnection, and handling errors. The suite of functions is called the BCI.

Search
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rleishman
Premium Member
Premium Member
Posts: 252
Joined: Mon Sep 19, 2005 10:28 pm
Location: Melbourne, Australia
Contact:

Post by rleishman »

Another way to do it is to use the After Subroutine to execute a DataStage Server job that runs the SQLs for you.
Ross Leishman
Post Reply