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:  

Customize the build file

The EGL build file contains the information necessary for EGL to communicate with your target environment.

Open the EGL build file

The build file must be configured once for each project to define options that will control the generation of the executable program code.

  1. Expand the EGLCALLWEB project.
  2. Expand EGLSource.
  3. Locate the EGL build file. This will be the project name with the extension .eglbld. In this example, it is EGLCALLWEB.eglbld, as shown in Figure 6.
  4. Double-click the build file to open it.

Figure 6. Open the build file
project explorer

The default build file editor opens.

Creating the linkage options for the program call

The linkage options are part of the build file, but they are handled by a different wizard. The linkage options describe where the remote object (in this case, the program on IBM i) resides, and what interface should be used to access it.

Now you will create the linkage option for the program call.

  1. Locate the Outline view in your workspace. It should be below the Project Navigator, as shown in Figure 7.
  2. If it does not show up, click the Outline tab to select it.

Figure 7. Open the Outline view
four workspace areas with tabs
  1. Right-click the eglcallweb.eglbld node in the tree and select Add Part, as shown in Figure 8.

Figure 8. Select to open the Add EGL Build Part dialog
context menu
  1. Select Linkage Options, as shown in Figure 9.
  2. Click Next.

Figure 9. Populate the EGL build file
choose the EGL part type
  1. On the dialog page displayed in Figure 10, type the name of the linkage option (in this case, callsysipgms)

Figure 10. Enter the part name
linkage options name and description

After you complete this one-time set up for your project, you can now use this to create linkages to any program on System i5 or other systems.

  1. When the dialog opens, click the Add button, as shown in Figure 11.

Figure 11. List of CallLink Elements
elements listed on left, properties on right
  1. Click inside the Program Name field and type the name of the program that you wish to call on IBM i. In this case it is GETDATAE.
    Note: You can add as many programs as you need to this list. EGL programs in the project may call any number of programs on your System i5 or other machines.
  2. Select remoteCall from the Type drop-down list.
  3. Click anywhere in the dialog and press Enter to make sure that the change applies.
    You will see that the program name GETDATAE and remoteCall appear in the right hand list of linkage options, as shown in Figure 12.

Figure 12. CallLink elements and properties
element listed on left, properties on right

Specify linkage values

  1. Provide the following property values (shown in Figure 13) exactly as listed in Table 1.

Table 1. Correct property values
PropertyValueComment
pgmNameGETDATAE should appear as default
typeremoteCall should appear as default
conversionTableCSOE037 CS letter O (Oh) E zero 37 See note below.
libraryEGLLABv7xx Name of the IBM i library where the program resides on the System i5, or nothing for libl.
locationiseriesd.dfw.ibm.com This is the TCP/IP name of your machine or the IP address.
remoteBindGENERATION Select from drop-down list.
remoteComTypeJAVA400 Select from drop-down list
remotePgmTypeSTATELESS Select from drop-down list

Note: EGL handles conversions from ASCII or UNICODE to EBIDIC in the IBM i system. The converstionTable property specifies the code page and language to use for conversions. The first four characters of the conversion table are always “CSOE” (letter oh, not zero). The last three digits are the three digit code for your national language. The code 037 is US English.


Figure 13. Property values now listed in view
Element on left, properties on right

After completing the entry for these properties,

  1. Save the Linkage options. Press Ctrl + S to save the entries.
  2. Select the eglcallwebWebBuildOptions tab to open the Build Options editor window, as shown in Figure 14.

Figure 14. Select the tab
tab at bottom of the window

Adding linkage to build file

In the Build options editor:

  1. Clear the Show only specified options check box to show all of the options that are available for the Build Options file.
  2. Find the linkage option shown in Figure 15
  3. Click the (no value set) entry field

Figure 15. Show all available options
options on left, symbolic parameters on right
  1. Click the little arrow at the end of the field. It will provide you with a list of all available linkages.
  2. Select callsysipgms, as shown in Figure 16.

Figure 16. Select a linkage value
drop-down list for selected value
  1. Select the Show only specified options check box options to reduce the number of options shown in the list, as shown in Figure 17.
  2. Save by using Ctrl+S.
  3. Click the X in the editor tab to close the editor.

Figure 17. Reduce displayed options
Options on left and parameters on right

4 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=