Throw warning from DS Server custom Routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 123
- Joined: Wed May 18, 2005 7:41 am
- Location: USA
Throw warning from DS Server custom Routine
How can we throw a warning message from a custom server routine when any of the else condition in a routine fails at job runtime.
Thanks
VS
Thanks
VS
Regards
VS
VS
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Call DSLogWarn(Message_Text, Routine_Name)
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: 123
- Joined: Wed May 18, 2005 7:41 am
- Location: USA
-
- Participant
- Posts: 123
- Joined: Wed May 18, 2005 7:41 am
- Location: USA
I Tried this in routine, it didn't work.
I have routine named "myroutine(Arg1) , Arg1 is "Code",
I am expecting 'X', 'Y' and 'Z' for Arg1, if any other value comes, I would like to throw a warning from myroutine
Eg:-
code = trim(code)
begin case
case code = 'X'
Ans = 1
case code = 'Y'
Ans = 2
case code = 'Z'
Ans = 3
case @true * (If any other value apperas for code)
Ans = I need to throw a warning at job runtime
end case
I am assigning this routine in the derivation.
Thanks
VS
I have routine named "myroutine(Arg1) , Arg1 is "Code",
I am expecting 'X', 'Y' and 'Z' for Arg1, if any other value comes, I would like to throw a warning from myroutine
Eg:-
code = trim(code)
begin case
case code = 'X'
Ans = 1
case code = 'Y'
Ans = 2
case code = 'Z'
Ans = 3
case @true * (If any other value apperas for code)
Ans = I need to throw a warning at job runtime
end case
I am assigning this routine in the derivation.
Thanks
VS
Regards
VS
VS
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Just put the call to DSLogWarn within the scope of CASE @TRUE (and make sure that Ans is assigned some value that can be handled by its caller, perhaps @NULL or -1.
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: 123
- Joined: Wed May 18, 2005 7:41 am
- Location: USA
Itried the following routine code, but its throwing compile errors,
Eg:-
code = trim(code)
begin case
case code = 'X'
Ans = 1
case code = 'Y'
Ans = 2
case code = 'Z'
Ans = 3
case @true * (If any other value apperas for code)
Ans = @null
DSLogWarn("Unexpected code appeared":code,"myroutine")
end case
Thanks
VS
Eg:-
code = trim(code)
begin case
case code = 'X'
Ans = 1
case code = 'Y'
Ans = 2
case code = 'Z'
Ans = 3
case @true * (If any other value apperas for code)
Ans = @null
DSLogWarn("Unexpected code appeared":code,"myroutine")
end case
Thanks
VS
Regards
VS
VS
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Comment must be a separate statement. See CASE @TRUE line.
Code: Select all
code = trim(code)
begin case
case code = 'X'
Ans = 1
case code = 'Y'
Ans = 2
case code = 'Z'
Ans = 3
case @true ; * (If any other value apperas for code)
Ans = @null
DSLogWarn("Unexpected code appeared":code,"myroutine")
end case
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.