350 pts.
 Can RPG call a VB script
I know very little about anything on a PC. Is there some kind of interface that could be used to execute a VB script which performs a function which returns a parm and get that parm returned back to the RPG pgm.

Software/Hardware used:
AS/400 Windows
ASKED: September 4, 2010  6:56 PM
UPDATED: September 7, 2010  1:11 PM

Answer Wiki:
There are almost always facilities available for cross-platform (remote) program calls. The calls are usually easier to set up and execute than the setup of the security configurations that are needed. When a system allows external program calls, you should ensure that authentication and authorization is satisfied. You usually can't risk allowing a system simply to run any remote command that comes into it. The calls themselves can be the easy parts. But... Commonly, the next problem to solve is to "get that parm returned back to the RPG pgm". That usually requires some kind of structured environment like a stored procedure. Return parms need format definitions that are available on both sides. Related to this for your situation are ASCII/EBCDIC and details like big-/little-endian values. Perhaps the best solution is to go with sockets. Java sockets make it fairly easy to make calls from RPG, but calling VBA from Java can be tricky. VBA isn't quite as 'open' as it could be. So, maybe seek out one of the general tutorials on { VBA sockets programming } with Google. Technically, RPG could use rexec() or even RUNRMTCMD to invoke a VBA process. There wouldn't be a "parm" that could be returned, but with RUNRMTCMD at least the standard output from the called process is returned as a spooled file. RPG could always parse the value out. VBA could generate the output. I don't know if any method is simpler. In short, there are a variety of methods. Most of them require knowing the technology before expecting success. It won't be easy unless you already have an environment that provides the framework such as database stored procedures. Tom
Last Wiki Answer Submitted:  September 6, 2010  9:35 am  by  TomLiotta   110,105 pts.
All Answer Wiki Contributors:  TomLiotta   110,105 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _