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.
Missing Routine
Moderators: chulett, rschirm, roy
Missing Routine
Hope This Helps
Regards
Regards
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.