Archive for RPG ILE

ILE in 2E Introduction

ILE programming has been around a while but many CA 2E / Synon shops still have not converted over to generating ILE RPG or ILE COBOL. I would like to give a short overview of ILE and then go into how to generate and work with ILE programs within CA 2E / Synon.

What is ILE?

The Integrated Language Environment on the IBM i is an environment for creating programs that bind modules of code into one program. Code can be written in ILE versions of C, CL, RPG or COBOL on the IBM i. Since code is reused you can end up writing programs with less code, less time and more efficiently.
Structure of an ILE Program
An ILE program contains one or more modules. A module contains one or more procedures.

Basic ILE Terminology

1. Activation

This is the process of getting the final ILE program ready to run. It consists of allocating the static data needed for running the program and sets physical address links to service programs.

2. Binding

Binding the process of connecting all the items needed for an ILE program to run.

3. Binding Directory

A binding directory is a way to identify in sort of a “list” the components necessary to bind into an ILE program.

4. ILE Program

An ILE Program is the combination of modules and other necessary objects that make up a functional program.

5. Module / Module Object

A module is code that cannot run by alone. Modules must be combined into a program in order to be run.

6. Procedure

A procedure is a set of statements in one of the ILE languages that performs a specific function. Once it is finished with its task it returns to the code that called it.

7. Service Program

A service program is a collection of procedures that can be run by other service programs or ILE programs. They are building blocks to the ILE similar to how subroutines are used in RPG or COBOL.

How does CA 2E /Synon handle ILE?

1. Define ILE components

CA 2E / Synon lets you identify which external functions are programs and which programs are modules. When on the Edit Functions Screen Details screen there is an option to toggle the compilation type, T. This option will toggle between compilation as an ILE Program or an ILE Module. In order for this function to work you do need to be targeting either RP4 (RBG ILE) or CBI (COBOL ILE). You might also need to use the O for compiler overrides to for the binding directory. Your environment will already be set up with a default binding directory.

2. Include components

In order to utilize the benefits of ILE in CA 2E / Synon be sure to follow the model of having the Program consist of several reusable functions. This is simple in 2E as you just need to define the functions correctly and then they will correctly be reused in your ILE programs when they are bound together.

3. Generating ILE Source

There is no difference in the actual process of generating source. It is normally best to generate code with a J. If you generally generate code with a G you can continue with that method as well.

4. Introduction to Service Programs in CA 2E / Synon

CA 2E includes a function type of service program (*SRVPGM). Just like in native ILE, a service program refers to one or more functions that are defined as modules. When used correctly service programs can improve performance.

In order to modules simply select M from Edit Function Details and then add existing modules to the service program.

Conclusion

This short introduction should get you started with ILE in CA 2E / Synon. Keep watching this blog and there will be more discussions about ILE in 2E.

 

 
 
© 2013 CM First Group - All rights reserved