Missing Routine

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
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Missing Routine

Post by thurmy34 »

Hi All
I wonder if it's possible to proctect myself against a missing routine when i use the deffun function.
Obviously the job will abortbut i want to have a message that the production can clearly understand.
Hope This Helps
Regards
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Check whether the Catalog name (for example DSU.MyRoutine) exists in the VOC file.

Code: Select all

RoutineName = "DSU.MyRoutine"
Test = Trans("VOC", RoutineName, 0, "X")
If Test = ""
Then
   Msg = "Routine MyRoutine does not exist in this project."
   Call DSLogWarn(Msg, "Control")
End
Else
   * regular processing
End
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Thanks a lot.
It works perfectly.
I also found the DSCheckRoutine function while searching for Trans in the documentation.
Hope This Helps
Regards
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Indeed, and there's also the internal function !EXIST that you might have found when browsing through the DataStage BASIC manual one sleepless night.

DSCheckRoutine() is a little more thorough than my code, as it makes sure that the VOC entry is indeed that of a routine, which mine doesn't. It also invokes !EXIST in case the routine is globally cataloged.

So you should probably prefer it.

Code: Select all

Found = DSCheckRoutine(RoutineName)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Thank you for your feedback.
I'll take DSCheckRoutine.
Hope This Helps
Regards
Post Reply