Forums >> Programming >> RPG Programming >>
Creating The Environment


Creating The Environment

Creating The Environment

The environment I chose to create for a "Fresh Start" is a library named ILESAMPLE.

First, I created the library:


Next, I created the source physical files:





The four source physical files I am created are as detailed as the following:

  • QRPGLESRC - This is where our RPG Programs will be held
  • QMODSRC - This is where the source for our RPG modules will be held
  • QCOPYSRC - This is where the source for our RPG /COPY books will be held.  This will contain mainly prototype definitions.
  • QSRVSRC - This is where the binder language for our ILE service programs will he held.

Now if you're already confused, don't be.  Things will make more sense as we go through the examples.

But, the first glaring issue would be the terms Module and Service Program.  I'm sure you've heard them before, and maybe even asked about them only to be more confused as to the difference, and when to use each one.  But, for now, just think of things this way:  

You create a Module which contains the subprocedures (or functions).  This Module can be bound "by copy" to your programs so the subprocedures within can be used.  This means a physical copy of the module is added to the program.

A Service Program is created from a Module.  Think of a Service Program as a "Stand Alone" copy of the Module.  In other words, when you use the subprocedures within a service program it's like calling a separate program on your system.  

Service Program

The call to a subprocedure for a Module and a Service Program will look exactly the same.  The only difference will be that the Service Program will be on it's own, and a Module must be "Bound" to the program.

Again, this will make more sense once we get into the gritty details, so lets get started with our first module.


Last edited 03/29/2015 at 15:53:42


Copyright 1983-2017 BVSTools
GreenBoard(v3) Powered by the eRPG SDK, MAILTOOL Plus!, GreenTools for Google Apps, jQuery, jQuery UI, BlockUI, CKEditor and running on the IBM i (AKA AS/400, iSeries, System i).