DataStage Routines - What Are they?

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
wfkurtz1
Premium Member
Premium Member
Posts: 17
Joined: Sat Oct 30, 2010 6:59 am
Location: Philadelphia
Contact:

DataStage Routines - What Are they?

Post by wfkurtz1 »

Could someone give me a brief description of what a DS Routine is and when, why & where I might want to use one?

Thanks in advance.
"The price of freedom is eternal vigilance."
-- Thomas Jefferson
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

A DataStage parallel routine is an external function, written in C++, to perform any task that you like but which, for example, it is too tricky to achieve using regular Transformer stage expressions. One example is the ability to replace one substring with another anywhere in a main string, the so-called Ereplace() function.

Parallel Routines as viewed in the Repository are not routines at all, but rather metadata that record the existence, location, type and arguments of these external functions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And since we're in the General forum...

Server routines are written in DataStage BASIC and can be used in much the same manner as Ray noted but in the Transformer stage in a Server job. They also are what you can run 'Before' or 'After' jobs or stages and are what the Routine Activity stage in Sequence jobs run.

Like any routine, they can vary from the terminally simple to extremely complex. The 'job control' code I have in my toolkit (courtesy of Uncle Ken) is a thousand or more lines of routine code. Never bothered to count it all. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
wfkurtz1
Premium Member
Premium Member
Posts: 17
Joined: Sat Oct 30, 2010 6:59 am
Location: Philadelphia
Contact:

Post by wfkurtz1 »

Thanks guys. Once created can a routine be manipulated similarily to a stage type and be instantiated as a step in the flow of a job? Do you know if any of the 30+ pdfs in the doc set explain routines?
"The price of freedom is eternal vigilance."
-- Thomas Jefferson
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Routines are separately-callable components - so the answer to your question is "yes". Manuals are the DataStage Programmer's Guide and the DataStage BASIC manual.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply