Introduction
This tutorial describes how to write Enterprise Generation Language (EGL) code that calls programs (RPG, COBOL, CL, CL Commands, or programs written in any supported language) on your System i5 machine.
The process for you to call an existing IBM i program from EGL has been very much improved in IBM® Rational® Developer for System i™ V7.1 (and later), and is incredibly simple.
EGL leverages the IBM i Toolbox for Java™, which in turn utilizes the System i5’s Remote Command Host Server (QZRCSRVSD in the QSYSWRK subsystem).
This tutorial will guide you thru the following steps:
-
EGL and the IBM i runtime environment.
-
Configuring your EGL Web Project to access the System i5 server and call a program
-
The actual code to call an IBM i program
-
Debugging both RPG and EGL code.
EGL and the System i5: Calling IBM i Programs
Calling an RPG, COBOL, CL, or other supported program on IBM i from EGL is as simple as coding:
CALL “myProgram” (parm1, parmN)
The facility is, however, extremely flexible and supports the many options that may be required to support many possible options and configurations. In this scenario, an EGL developer is working on Rational Developer for System i SOA on their workstation and running an EGL application under the IBM® WebSphere® Test Environment.
EGL uses the IBM i Toolbox for Java to call programs on the System i5. The toolbox in turn uses the System i5 Remote Command server that is a part of the System i5 Host Servers.
The following steps might sound a bit intimidating, but don’t worry: everything just happens automatically and you don’t really need to do anything to make this happen.
The Remote Command server in System i5 consists of a server daemon program that listens for TCP/IP requests from clients. This program is QZRCSRVSD, which runs in the QSYSWRK sub-system.
-
When the Remote Command Server starts, it starts a number of “worker” jobs that process requests in the QUSRSYS sub-system. These jobs are all named QZRCSRVS.
-
The workstation will utilize the Java Toolbox to establish a connection with the Remote Command server on the IBM i QZRCSRVSD).
-
The remote command server daemon (QZRCSRVSD) will locate an available work job (QZRCSRVS in the QUSRWRK sub-system).
-
The user is authenticated. The SWAP ID API will be issued to switch the QZRCSRVS job from QUSERS to the ID passed in by EGL.
Finally, the user program will be called.
Return parameters will be returned up the path back to the invoking EGL program.
|