Is it possible to call ExecSh from a "regular" (not Before/After) routine? If so, what do I have to put in the DefFun statement to do this?
Thanks,
Tony
Calling ExecSh from another routine
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
But, if you really, really wanted to, you'd need an appropriate DEFFUN declaration
ExecSH is in DSU (not DSD or DSG) because it is supplied as an example of user-written before/after routine.
Code: Select all
DEFFUN ExecSH(InputArg, ErrorCode) Calling "DSU.ExecSH"
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.
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
That's what I thought too, Ray.
When I call that routine using the DefFun that you supplied, I get:
Tony
When I call that routine using the DefFun that you supplied, I get:
My code is:Program "DSU.UnixCmdTest": Line 11, Unable to open the operating system file "DSU_BP.O/ExecSH".
Code: Select all
FUNCTION UnixCmdTest(Arg1)
DEFFUN ExecSH(InputArg, ErrorCode) Calling "DSU.ExecSH"
Cmd = ""
RetCode = ""
Cmd = "pwd"
Call ExecSH(Cmd, RetCode)
Ans = RetCode
RETURN(Ans)