Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Calling IBM i programs from EGL using Rational Business Developer

Claus Weiss, Advisory Software Consultant, IBM
Claus Weiss is an advisory software consultant with the Rational Software System i – Ecosystem team at the IBM Canada Toronto Laboratory. He has degrees in industrial engineering and computer science from the University of Hamburg in Germany. He worked as a systems engineer with IBM Germany and joined the IBM Toronto Laboratory in 1984. He was a developer and team leader for System/38 development tools. He has been a member of the Design Control Group for the AS/400 development tools. He has worked as a consultant for IBM iSeries Application Development for the past 10 years, specializing in Visual Tools. Claus is a frequent speaker at COMMON and other iSeries conferences and a six-time winner of COMMON's Speaker Excellence award. He is also the lead author of the book title "Understanding the IBM WebFacing Tool," published by IBM Press, and has co-authored several IBM Redbooks.

Summary:  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 IBM® 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).

Date:  19 Aug 2008
Level:  Intermediate PDF:  A4 and Letter (3472 KB | 44 pages)Get Adobe® Reader®

Activity:  290 views
Comments:  

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.

  1. 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.
  2. The workstation will utilize the Java Toolbox to establish a connection with the Remote Command server on the IBM i QZRCSRVSD).
  3. The remote command server daemon (QZRCSRVSD) will locate an available work job (QZRCSRVS in the QUSRWRK sub-system).
  4. 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.

2 of 9 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational, Sample IT projects
ArticleID=330659
TutorialTitle=Calling IBM i programs from EGL using Rational Business Developer
publish-date=08192008
author1-email=weiss@ca.ibm.com
author1-email-cc=