ILERPG.com — IBM i · ILE RPG · AS400 Mastery

This lesson is locked

A short preview is available. Purchase once for lifetime access.

Beginner · 18:22

Copy Members and Modular Source Organization

Once a procedure is called from more than one place, its prototype must be identical everywhere it is used. This lesson covers the compiler directives that make that possible — /COPY and /INCLUDE from source physical files and from IFS stream files — and the conditional-compilation directives…

What you'll be able to do

  1. 1Use /COPY and /INCLUDE to bring source from a source physical file member or an IFS stream file into a compile, and state how the SQL precompiler treats each.
  2. 2Build a copy member of prototypes, templates, and named constants, protected against double inclusion with /IF DEFINED, /DEFINE, and /EOF.
  3. 3Include the same prototype member in the implementing module and in every caller, and explain how that lets the compiler check the procedure interface against the prototype.
  4. 4Use conditional compilation to include optional code, such as trace output, controlled by a DEFINE value at compile time.
  5. 5Decide what belongs in a shared copy member and what must stay in the program, and choose clear source file and member naming conventions.

Create your account

Takes a few seconds — you'll be right back here after.

Sign in

Welcome back — you'll be right back here after.

Forgot your password?